[英]How to change legend size but not titles with ggplot in r?
ggplot function theme
有很多不同的指针,指向您想要更改的 plot 的不同功能。 调整您提供的代码 plot.title 只会增加绘图标题的字体大小。 轴标题和图例标题还有其他规范,它们也只会更改那些 fonts(请参阅axis.text
和legend.text
以及其他变体)。
grafico <- ggplot(meanIMcomunas, aes(x= IM, y= Comuna))
+ geom_point(aes(color = IM),size =2)
+ labs(title = "Promedio de IM por comuna")
+ theme(plot.title = element_text(size = 20))+
scale_color_viridis(option = "D")
保存时可以通过指定宽度和高度并更改单位来更改 plot 的大小:
ggsave(grafico, file = "my_file.png", width = 10, height = 10, units = "in")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.