[英]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.