【发布时间】:2020-10-17 12:37:38
【问题描述】:
我想对箱线图进行排序。
'left is high box' and 'right is not high'
ggplot(data = iris ,aes(x = Species,y=Sepal.Width)) +
geom_violin(fill='gray')
我做了这个代码,setosa:left 和 virginica:right。
但是每个物种的 max(Sepal.Width),Versicolor 最少。
我想将 setosa-virginica-versicolor 引用排序为 max(Sepal.Width)。
【问题讨论】:
-
这个问题已经出现在早期的线程中。也许stackoverflow.com/a/43221332/6503141 或stackoverflow.com/a/30494457/6503141 或在stackoverflow.com/a/3464682/6503141 中使用
xlim或通常搜索ggplot order boxplot 应该会有所帮助