GuangchuangYu/yyplot

Error in ggbaxis

microly opened this issue · 2 comments

d = data.frame(x=c(rnorm(5)+4,rnorm(5)+20,rnorm(5)+5,rnorm(5)+22), y=1:20)
mymin = function(x) ifelse(x <= 7, 0, 17)
p <- ggplot(d, aes(x, y)) + geom_rect(aes(xmin=mymin(x), xmax=x, ymin=y-.4, ymax=y+.4))
ggbaxis(p, axis="x", breaks=c(7, 17))

Error in .subset2(x, i, exact = exact) : 在1层没有这一索引

thanks~