library(ggplot2)
#example dataset:
mydata = data.frame(x = 1:10, y=1:10
, cat = c(rep('first', 3), rep('second', 3), rep('third', 4)))
#create (a), (b), ...
my_plotlabels = paste0('(', letters, ') ')
#paste plot labels together with the levels of the variable used for faceting
levels(mydata$cat) = paste0(my_plotlabels[1:length(levels(mydata$cat))]
, levels(mydata$cat))
ggplot(mydata, aes(x=x, y=y))+
facet_wrap(~cat)+
geom_point(size=2, shape=7)+
theme_bw()
view raw plot_labels.R hosted with ❤ by GitHub