I am creating a times series using ggplot2 in R. I would like to know how to show tick marks in the x-axis only for the months that are labeled (e.g. Mar 07, Mar 08, etc) while keeping the vertical grey lines for every single month.
The main reason is because having a tick mark for every month makes it hard to know which one correspond to the labels.
Here is an example of a plot:

Here is the line of R behind:
ggplot(timeseries_plot_data_mean,aes(as.numeric(project_date)))+
geom_line(aes(y=num_views))+geom_point(aes(y=num_views))+
stat_smooth(aes(y=num_views),method="lm")+
scale_x_continuous(breaks = xscale$breaks, labels = xscale$labels)+
opts(title="Monthly average num views")+xlab("months")+ylab("num views")
This is what would like to generate. See how the ticks are positioned right above the month label and the vertical lines are still there showing each month.

I manually edited the plot above using Inkscape, (ignore the q’s, Inkscape strangely replaced the dots for q’s)
Here is a solution using the
minor_breaksparameter ofscale_x_date(). To use this, your x-values must be of classDateinstead ofnumeric.