旋转箱线图方向并设置notch
ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot(notch=TRUE) + coord_flip()
?...4)添加最大值和最小值的两条须线
ggplot(ToothGrowth, aes(x=dose, y=len)) +
stat_boxplot(geom = "errorbar",width=0.15...1)分组更改箱线的颜色
p<-ggplot(ToothGrowth, aes(x=dose, y=len, color=dose)) + geom_boxplot()
p
?...2)更改箱子填充颜色
fill 填充色 ; color 箱线的外框颜色
#单组 设置颜色
ggplot(ToothGrowth, aes(x=dose, y=len)) + geom_boxplot(fill...ggplot2-box-plot-quick-start-guide-r-software-and-data-visualization
ggplot2:数据分析与图形艺术
好了,就是这么简单,输出基本图形后,根据自己的喜好进行细节的调整即可