我有以下代码:
ggplot(iris, aes(x=Species, y=Sepal.Length)) + stat_summary(fun.y=mean, geom='point', size=2, fill='white')
我知道有可能使用 iris 数据绘制这个均值的其他方法 . 但是,对于我自己的数据,这是唯一的方法 .
iris
问题:上面的代码不会给出白色填充点,而是纯黑色点 . 使用 stat_summary 参数时是否有设置填充颜色的方法?
stat_summary
谢谢!
要么使用 color 而不是 fill
color
fill
ggplot(iris, aes(x=Species, y=Sepal.Length)) + stat_summary(fun.y=mean, geom='point', size=2, color='white')
或使用具有填充和边框颜色的符号形状
ggplot(iris, aes(x=Species, y=Sepal.Length)) + stat_summary(fun.y=mean, geom='point', size=2, shape=21, fill="blue", color="red")
1 回答
要么使用
color
而不是fill
或使用具有填充和边框颜色的符号形状