Hi All,
I have tried to add a main title with a subscript unsuccessfully. However, the subscript on the y axis was OK. How can I do that? I also want to add a space between PM10 and µg/ m3 on y axis. Reproducible data and code is found below
Thanks
library(ggplot2)
library(reshape2)
PM10<- rnorm(365, 50, 25)
date<-seq(as.Date('2011-01-01'),as.Date('2011-12-31'),by = 1)
df<-data.frame(date,PM10)
dfmelt = melt(df, id.vars = 'date')
ggplot(dfmelt, aes(x = date, y = value)) +
geom_line() +
labs(title=("Concentrations of PM[10] in 2012")) +
#theme(title = expression("Concentrations of PM[10] in 2012")) ,
ylab(expression(paste(PM[10], ("µg" / m^3)))) +
theme(plot.title = element_text(size = 17,face="bold" )) +
theme(axis.text=element_text(size=17),
axis.title=element_text(size=17,face="bold")) +
facet_wrap(~ variable, scales = 'free_y', ncol = 1)