我该如何修理我的x轴?

时间:2018-05-01 22:28:13

标签: r ggplot2

这是我用房屋价格绘制出售房屋的月份和年份的图表。我想知道如何在不丢失图表中太多信息的情况下让x轴看起来更好。

这是我的代码:

month_year_of_date <- paste(month_of_date, year_of_date, sep = "/")

ggplot(housing_data, aes(x = factor(month_year_of_date), y = housing_data$price)) + 
    geom_point()

plot(factor(test), housing_data$price)

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以将标签旋转45度,如下所示:

theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
相关问题