如何订购geom_col ggplot的条

时间:2020-05-10 19:25:33

标签: r ggplot2 histogram

我已经创建了直方图,但是我想按desc排序条形图

mediatweets%>%
ggplot( aes(screen_name, as.numeric(count))) +
  geom_col(fill = 'firebrick') + 
  theme_minimal(base_size = 14) +
  xlab(NULL) + ylab(NULL) +
  geom_text(aes(label = count, y = count+15), position = position_dodge(0.9), vjust =0.5,size=3)+
  scale_x_discrete(limits = mediatweets$screen_name) + coord_flip()+
  ggplot2::labs(
    x = NULL, y = NULL, #Info en cada eje 
    title = "Tweets sobre el COVID-19 por día" #Texto 
  )

0 个答案:

没有答案