增加 image.plot 图例中的字体大小 [英] Increase font size in legend of image.plot

查看:58
本文介绍了增加 image.plot 图例中的字体大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

如果我使用了一个额外的参数(比如 legend.args),我发现我只增加了图例标题的标签.

If I am using an extra argument (like legend.args) I observed that I increase only the label for the legend title.

推荐答案

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

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

这篇关于增加 image.plot 图例中的字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆