[英]Change the scaling in the legend for the size of dots which indicates the value
兩條一般性評論:
aes
內使用$
-indexing。 請參閱這篇文章,以了解如果這樣做會出錯。 關於您的問題,您可以使用scale_size_continuous
。 這是基於mtcars
的可復制示例
ggplot(mtcars, aes(mpg, disp, size = hp)) +
geom_point() +
scale_size_continuous(
breaks = c(10, 50, 500, 1000),
limits = c(0, 1000))
請注意, scale_size
縮放點的面積,而scale_radius
縮放半徑。 scale_size
是scale_size_area
的替代方法,可確保將值0映射到大小0。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.