其中,当我指定在y轴限制杆不会呈现我在与geom_bars的问题。 我认为以下应重现该问题:
data <- structure(list(RoleCond = structure(c(1L, 1L, 2L, 2L), .Label = c("Buyer", "Seller"), class = "factor"),
ArgCond = structure(c(1L, 2L, 1L, 2L), .Label = c("No Argument", "Argument"), class = "factor"),
mean = c(2210.71428571429, 2142.70833333333, 2282.40740740741, 2346.2962962963),
se = c(20.1231042081511, 16.7408757749718, 20.1471554637891, 15.708092540868)),
.Names = c("RoleCond", "ArgCond", "mean", "se"), row.names = c(NA, -4L), class = "data.frame")
library(ggplot2)
ggplot(data=data, aes(fill=RoleCond, y=mean, x=ArgCond)) +
geom_bar(position="dodge", stat="identity") +
geom_errorbar(limits, position=dodge, width=0.1, size=.75) +
scale_y_continuous(limits=c(2000,2500))
这给了我这个
没有规定的限值相同的代码工作正常。 该geom_errorbar()似乎并没有涉及到这个问题,但它确实说明在酒吧应该显示出来。
我已经尝试使用coord_cartesian(ylim=c(2000,2500))
其适用于限制y轴和获取条显示,但轴标签搞的一团糟,我不明白我用它做。
感谢您的任何建议! (我,使用R 2.15.0和GGPLOT2 0.9.0)