r - GGplot 2:如何在条形图中从最大到最小设置x轴
问题描述
我知道很多人都问过这个问题,但由于问题与我的不同,我发现答案太混乱了。目前,当我希望它们从最大到最小排序时,我的 x 值(物种)只是随机排序的。
代码:
ggplot(moth.abundance, aes(x=Species, y=Total)) +geom_bar(stat='identity')+theme_classic()+labs(x='Moth Species', y='Count')+
theme(axis.text.x = element_text(angle = 90))
解决方案
推荐阅读
- linux - 如何从 ps -ef 的输出中获取进程 ID | grep 'tomcat'?
- algorithm - 动态表数据结构摊销分析
- c++ - 分段错误通用双链表
- html - 背景图像未从顶部 CSS 中出现
- azure - 需要将 CRT 文件从 Sectigo (Comodo) 转换为 pfx for azure
- kotlin - 在 Kotlin 中,是否可以为不同的对象设置不同的枚举值,类似于 Python 处理枚举值的方式?
- azure-devops - 在 Azure YAML 管道中将 PSCustomObject 作为全局变量传递
- python - 我希望我在 pygame 中的角色不会离开屏幕
- pyephem - PyEphem 的数据源?
- c++ - sstream 字符串错误输出