text 带有yearqtr x轴的条形图

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 带有yearqtr x轴的条形图相关的知识,希望对你有一定的参考价值。

ggplot(dat, aes(x = year_quarter, y = percent_positive)) + 
  geom_bar(stat = "identity") +
  labs(x = "Year and quarter", y = "% positive", title = "% positivity by quarter") +
  theme_minimal()+
  scale_x_yearqtr(format = "%Y-Q%q", n=9)+  # makes the format and number of axis labels)
  theme(axis.text.x = element_text(angle = 35, hjust = 1)) # sets angle of labels
  

以上是关于text 带有yearqtr x轴的条形图的主要内容,如果未能解决你的问题,请参考以下文章