Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
To remove just the tick labels, as in Figure 8-14 (left), use theme(axis.text.y = element_blank()) (or do
the same for axis.text.x).
This will work for both continuous and categorical axes:
p<-ggplot(PlantGrowth,aes(x=group,y=weight))+geom_boxplot()p+theme(axis.text.y=element_blank())
To remove the tick marks, use theme(axis.ticks=element_blank()). This will
remove the tick marks on both axes. (It’s not possible to hide the tick
marks on just one axis.) In this example, we’ll hide all tick marks as
well as the y tick labels (Figure 8-14, center):