我有一個比例vs名稱的圖。我試圖通過比例來命令一個ggplot,但即使我命令數據幀,該圖也想根據x軸值按字母順序排列事情。如何以Y軸值改爲訂購如何根據變量在ggplot中訂購點我指定
resultOrder <- result[order(result$Proportion), ]
ggplot() +
geom_point(aes(resultOrder$Names, resultOrder$Proportion), resultOrder) +
geom_point(shape=1) +
labs(title="Number of SVs each repeat element is found in (as a percentage, filtered for >20%)", x="TY [°C]", y="Txxx") +
#geom_point(aes(mergedGroup4$Rptname, mergedGroup4$PercentageChangeForWholeSV),mergedGroup4) + theme(axis.text.x=element_text(angle=-90)) +
xlab("Repetitive elements") +
ylab("Percentage of SVs") +
theme(axis.text.x=element_text(angle=-90)) +
theme(legend.position="top")
的樣本數據
Names Values Proportion
FLAM_C FLAM_C 1112 20.03965
MER112 MER112 1115 20.09371
L1MA10 L1MA10 1116 20.11173
L1PB3 L1PB3 1121 20.20184
LTR78B LTR78B 1125 20.27392
MLT1H1 MLT1H1 1126 20.29194
(TG)n (TG)n 1127 20.30997
Charlie7 Charlie7 1129 20.34601
MamRep605 MamRep605 1133 20.41809
LTR16A LTR16A 1136 20.47216
Charlie1b Charlie1b 1139 20.52622
L1PA6 L1PA6 1142 20.58028
MLT1G1 MLT1G1 1148 20.68841
LTR67B LTR67B 1150 20.72445
MER58A MER58A 1162 20.94071
您可以將您的原data.frame結果的代表性? – 2015-02-07 21:17:39
請參閱'help(reorder)' – davechilders 2015-02-07 21:22:10
請參閱下面的答案。 – 2015-02-07 22:37:06