x轴上的月数,而不是数字

问题描述 投票:0回答:1

我想将x轴上的数字转换为月份,我以某种方式成功了,但是我希望月份按时间顺序而不是字母顺序排列。

我使用了以下代码:

temp %>% 
  ggplot(aes(month.abb[MoSold], fill = SalePrice)) + 
  geom_bar() +
  scale_y_continuous(labels = number) +
  xlab("Month") +
  theme_bw()

上面的代码正在产生以下图形months in alphabetical order.

相反,我希望图形看起来像名称而不是数字graph with chronological order without month name

r ggplot2 geom-bar ggplotly geom-text
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.