[英]ggplot2 - R - How to fix size of bubble in legend
我想使仅在图例中显示气泡颜色的形状更大。 我已经尝试过该站点的一些建议,但到目前为止我还很不幸。 下面是一个基本示例。
在此示例中,我希望“齿轮”的大小为10。这可能太大,但是我想验证它是否在工作。
library(ggplot2)
ggplot(mtcars
,aes(x=hp, y=disp, size=mpg, fill=factor(gear)))+
geom_point(shape=21)+
theme_bw()+
scale_size_continuous(range=c(2,15))+
guides(shape = guide_legend(override.aes = list(size = 10)))
更改shape
以fill
guides
将重新缩放图例元素的大小:
guides(fill = guide_legend(override.aes = list(size = 10)))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.