标签: r ggplot2
错误?可能相关to this..
dat = data.frame(x = 1:4, y = ordered(c(4,'>5',1,1), levels = c(1:5, '>5')), grp = 1) ggplot(dat, aes(x, y, group=grp)) + geom_step() + scale_y_discrete(breaks = levels(dat$y), labels = levels(dat$y))
答案 0 :(得分:5)
ggplot(dat, aes(x, y, group=grp)) + geom_step() + scale_y_discrete(breaks = levels(dat$y), labels = levels(dat$y), drop = FALSE)