0
我想要生成一個條形圖(使用ggplot2)的位置估計數據沿y軸和基本計數沿x軸計數。我的數據是結構化的,像這樣:ggplot2 - 按重量值排序圖
Data <- data.frame(locations = c("A","B","C","D"...), estimates = c(200, 300, 400, 200...)
然後我用dplyr據測算
library(dplyr)
Data <- Data %>% arrange(estimates)
於是我跑我的GGPLOT2代碼
library(ggplot2)
ggplot(Data, aes(locations, weight = estimates))+
geom_bar()+
coord_flip()
安排我的數據,但所產生的陰謀就是這樣,這些酒吧並沒有按照估計排序。