我有一个数据框total_likes
total_likes <- data.frame(month = c("June","July","August"),
likes =c(24413,28839,35060))
我想在x轴上绘制月份,在y轴上绘制。到目前为止,我有这段代码:
ggplot(total_likes, aes(x = month, y = likes , group = 1)) +
geom_point() +
geom_line(size = 1.5, colour = "blue")
轴问题有两个问题:
为什么x轴不在顺序&#34;六月,七月,八月和#34;?我该如何解决?
有没有办法让y轴从零开始而不是24000?
答案 0 :(得分:1)
订购您的数据
total_likes <- data_frame(month = ordered(c("June","July","August"), month.name),
likes =c(24413,28839,35060))