简体   繁体   中英

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). 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.

Changing legend.cex will change the size of a legend text label:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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