I have a qplot and when I graph it, it splits up the x-axis automatically. I want to change that to split it up by defined sequential breaks, so I tried this:
breaks <- seq(a,b,7)
qplot(data=data, x=xvar, y=yvar, colour=yvar, group=grouping,
geom=c("point", "line")) +
scale_x_discrete(breaks = breaks, labels=paste("Break", breaks))
However, this didnt work. In fact, nothing shows up on the x-axis when I do that.
Sample:
xvar yvar grouping
1 1 25 1
2 2 30 1
3 3 28 1
4 4 27 1
5 5 40 1
...
70 70 20 1
breaks <- seq(1,70,7)
Since your
xvariable data is continuous, you need to usescale_x_continuous. You may also want to rotate the x labels by 90 degrees: