由于终端用户要求很高,我需要了解geom_box图形上的晶须线是否可以与盒子本身不同的颜色或类型?
在考虑了boxplot with colored and dotted lines之后,我创建了一个最小的示例。
year <- rep("2014", 10)
total <- c(seq(55, 90, 5), 100, 40)
df <- data.frame(year = as.factor(year), total = total)
ggplot(df, aes(x=factor(year), y=total)) +
geom_boxplot(linetype = "dotted", color = "red") +
theme_bw()下面的情节可以有绿色的胡须,保留红色的盒子,或者实心的胡须保留虚空的盒子吗?

这个问题告诉我们,基本R允许晶须线定制。bxp has several parameters
发布于 2015-03-31 17:38:56
编辑后的评论:我没有发现这样的问题,user20650亲切地指出。这是它的答案--两次情节盒情节。
ggplot(df, aes(x=factor(year), y=total)) +
geom_boxplot(linetype = "dotted", color = "red") +
geom_boxplot(aes(ymin=..lower.., ymax=..upper..)) +
theme_bw()https://stackoverflow.com/questions/29372200
复制相似问题