我想重新排列我的bar_plot從最高值到最低值。我的代碼有什麼問題?基於價值列重新排列geom_bar
head(summary.m)
Var1 Var2 value
2 u-A Length 1155
3 u-AA Length 422
4 u-AAA Length 119
5 u-AAC Length 6
6 u-AAG Length 19
7 u-AAT Length 49
ggplot(summary.m, aes(x=reorder(Var1,-value),y=value)) + geom_bar(stat="identity") +
theme_bw(base_size=8) +
theme(axis.text.x = element_text(colour = "black",angle=90))
這可能有助於:https://kohske.wordpress.com/2010/12/29/faq-how-to-order-the-factor-variables-in-ggplot2/ – mts