There must be an easier way to add customized ticks and labels in a plot using ggplot2 than creating custom function to do it like some answers in the forum...
Here's my code,
data<-data.frame(WS_Spd_WVT=c(0.5,1.2,4.2,0.3),C_E=c(100,200,150,50))
plot8 <- ggplot(data=data,aes(x=WS_Spd_WVT,y=C_E)) + geom_point(color='blue') +
scale_y_continuous(breaks=seq(-200,500,by=100)) +
ylim(-100,500) +
theme(panel.background = element_rect(fill='white',color='black'),panel.grid.major=element_line(size=0.5,color='gray'),panel. grid.minor=element_line(size=0.25,color='gray')) +
ylab(expression('C'[E])) + xlab('U') + scale_x_continuous(breaks=seq(0,14,by=1),minor_breaks=seq(0,14,by=0.5))
plot8
I just need to add 0.5 tick marks with labels (e.g., 1.5,2.0,2.5, etc) for the x-axis and (50, 100,150, 200, etc.) for the y-axis. Is it possible to add even minor ticks to the minor tick marks for the y-axis?
While I am at it, anyway to change the major axis label size and the minor axis label size separately instead of using 'base_size?'