使用ggplot2 3.0.0,我在此处创建了箱线图:geom_boxplot with precomputed values
但是不能控制盒子的宽度。
DF <- data.frame(x = c("2012","2016"), min = c(29.9,37.0), low=c(64.0,58.0), mid=c(108.0,73.0), top=c(168.0,108.0), max=c(258.0,199.0))
ggplot(DF, aes(x = x, ymin = min, lower = low, middle = mid, upper = top, ymax = max)) +
geom_boxplot(stat = "identity", fill = "cornflowerblue")