Reputation: 37
I have a data frame total_likes
total_likes <- data.frame(month = c("June","July","August"),
likes =c(24413,28839,35060))
I want to plot month in x axis and likes in y axis. So far I have this code:
ggplot(total_likes, aes(x = month, y = likes , group = 1)) +
geom_point() +
geom_line(size = 1.5, colour = "blue")
Two questions axis questions:
Why is the x axis not in the order "June,July,August"? How can I fix it?
Is there a way to make a y axis start from zero not 24000?
Upvotes: 0
Views: 261
Reputation: 2050
order your data
total_likes <- data_frame(month = ordered(c("June","July","August"), month.name),
likes =c(24413,28839,35060))
Upvotes: 1