简体   繁体   English

增加image.plot图例中的字体大小

[英]Increase font size in legend of image.plot

I have to use this image.plot function from fields package in R to plot a matrix (I prefer to use raster package for this usually). 我必须使用R中的fields包中的image.plot函数来绘制矩阵(通常我更喜欢使用raster包)。 I can not increase the font size in the legend in order to export the plot at a properly resolution. 我无法增加图例中的字体大小以正确的分辨率导出图。

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

If I am using an extra argument (like legend.args ) I observed that I increase only the label for the legend title. 如果我使用额外的参数(例如legend.args ), legend.args观察到我仅增加了图例标题的标签。

Changing legend.cex will change the size of a legend text label: 更改legend.cex将更改图例文本标签的大小:

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

If you want to change the size of the number values in the legend, try: 如果要更改图例中数字值的大小,请尝试:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM