【问题标题】:Increase font size in legend of image.plot增加 image.plot 图例中的字体大小
【发布时间】:2019-11-25 01:29:42
【问题描述】:

我必须使用 R 中 fields 包中的 image.plot 函数来绘制矩阵(我通常更喜欢使用 raster 包)。我无法增加图例中的字体大小以便以适当的分辨率导出绘图。

library(fields)
mat <- matrix(data = rnorm(500,55.3, 103), nrow = 250, ncol = 250)
image.plot(mat, legend.cex = 12) # nothing

如果我使用额外的参数(如legend.args),我观察到我只增加了图例标题的标签。

【问题讨论】:

    标签: r matrix plot


    【解决方案1】:

    更改 legend.cex 将更改图例文本标签的大小:

    image.plot(mat, legend.lab="Test", legend.cex = 12) # Test label in large size
    

    如果要更改图例中数值的大小,请尝试:

    image.plot(mat, axis.args=list(cex.axis=2)) # Legend numeric values in large size
    

    【讨论】:

      猜你喜欢
      • 2013-12-22
      • 2010-12-04
      • 1970-01-01
      • 2017-12-06
      • 2018-10-16
      • 2018-07-16
      • 2015-02-01
      • 1970-01-01
      相关资源
      最近更新 更多