我想翻转ggplot2 boxplot的坐标,我也做坐标转换。ggplot2 boxplot的翻转坐标
library(ggplot2)
dat = data.frame(group = factor(c(rep(1,3),rep(2,6))),
vals = c(c(0.1,2.25,1000), c(0.11,0.21,0.21,4.55,5.06,29.48)))
ggplot(dat,aes(group,vals)) + geom_boxplot()
ggplot(dat,aes(group,vals)) + geom_boxplot() + coord_trans(y="log10")
如果我刚才加 “+ coord_flip()”,该轴的对数标度丢失..
ggplot(dat,aes(group,vals)) + geom_boxplot() + coord_trans(y="log10") + coord_flip()
任何方式来实现COORDS的翻转?
感谢您的任何意见!
最佳, 孙燕姿
你读[这个苏答案(http://stackoverflow.com/a/26185278/1305688)? –
@Eric失败。哎呀。我没有看到这个评论。你首先建议。我应该删除我的答案吗? – boshek
感谢您的评论,我看过这篇文章。但是,它不能解决我的问题。看到我的评论下面的答案。无论如何谢谢! – steffi