Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个问题,我有重叠的轴标签,似乎无法找到解决这个问题的解决方案。
p <- ggplot(data=Data,aes(x=Indicator,y=Numeric,group=Expenditure_group,shape=Expenditure_group,colour=Expenditure_group))+geom_point()+geom_line()
有没有办法解决这个问题,以免重叠?
您可以通过自动缩写标签来调整您的 x 轴,如
p + scale_x_discrete(labels = abbreviate)
或者您可以自己提供缩写标签,如
p + scale_x_discrete(labels = c("Congenital Rubella" = "C. Rub.", ..., "Total tetanus" = "T. tet.", "Yellow fever" = "Y. fever")
见:http ://docs.ggplot2.org/current/scale_discrete.html