我试图控制以下ggplot中size = clarity
参数的相对大小:
library(ggplot2)
diamonds %>%
sample_n(100) %>%
ggplot(aes(x = depth, y = price, color = cut, size = clarity)) +
geom_point()
我尝试使用shape = 19
,在size
内移动geom_point()
无效。我只是希望图中的形状更小(不是图例)。有办法吗?
答案 0 :(得分:1)
您可以添加:
+ scale_size_discrete(range = c(0.5, 4))
并尝试范围值。默认值为c(1,6)。
请注意有关大小和离散变量的警告消息。