简体   繁体   English

是否可以更改基础 R 中的图例大小(无 ggplot2)

[英]Is it possible to change the legend size in base R (no ggplot2)

Good morning, I was wandering if there was an option (or a function whatsoever) that allows to modify the size of the "legend" square in a plot made with R base.早上好,如果有一个选项(或 function)允许修改 plot 中的“图例”正方形的大小,我正在徘徊,用 ZE1E1D3D40573127E9EE0480CAF18 制作。 I've looked up the web, but it seems that I can do everything with my legend but change its size.我查看了 web,但似乎我可以用我的图例做任何事情,但改变它的大小。 Does somebody know if it is possible?有人知道这是否可能吗? If yes, how?如果是,如何?

Thank you all in advance, Peppe提前谢谢大家,佩佩

Assuming a legend of this type假设有这种类型的图例

legend("topright",
       legend = c("Var 1", "Var 2"),
       col = 1:2,
       pch = 16,
       cex = 2.5)

cex manages the size of the legend cex管理图例的大小

Like this?像这样? Graphics parameter cex stands for c haracter ex pansion.图形参数cex代表c 字符扩展

plot(1)
legend("top", legend = "legend size test")
legend("bottom", legend = "legend size test", cex = 1.5)

在此处输入图像描述

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

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