I'm creating a line graph with ggplot that makes use of breaks
to display only some of the labels. The issue is when I do that, the non-labeled tick marks and more importantly, the grid lines associated with those tick marks disappear. I really need the grid lines to remain. The tick marks staying would be nice, but not essential.
The code below will produce a graph that shows what I'm dealing with.
Thanks!
count<-c(1,5,6,8,3)
period<-c(1,2,3,4,5)
df<-data.frame(count,period)
library('ggplot2')
ggplot(data=df, aes(x = period, y =count ,group=1)) +
geom_line(size=1)+
scale_x_discrete(breaks=c(1,3,5),
labels=c("One",'Two','Three'))