我想将条形图的限制固定在y=2 (ylim=2)
testdata <- data.frame(group=c(1,2),
xbar= c(3.410821 , 4.746693 ),
se = c(0.1593839,0.2435023))
xvals = with(testdata,barplot(xbar, names.arg=group,
main="",xlab="x",ylab="y",ylim=c(2,max(6))))
with(testdata,arrows(xvals, xbar, xvals, xbar+se, length=0.3, angle=90, code=2))