窃听器?可能相关的为了这个..。
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))

发布于 2017-03-29 08:37:51
ggplot(dat, aes(x, y, group=grp)) + geom_step() +
scale_y_discrete(breaks = levels(dat$y), labels = levels(dat$y), drop = FALSE)

https://stackoverflow.com/questions/43088354
复制相似问题