Producing graphs for scientific journals is rarely ever done without adding some special scientific and mathematical notations, such as subscripts, superscripts, symbols, and other notations. In this recipe, we will learn how to add these to annotations to our graphs.
We will only use base graphics functions for this recipe. So, just open up the R prompt and type in the following code. We will use the airpollution.csv
example dataset for this recipe. So, let's first load it:
air<-read.csv("airpollution.csv")
Let's make a scatter plot of concentrations of particulate matter versus nitrogen oxides and add titles with subscripts as in PM10 and NOX and units mg m-3:
plot(air,las=1, main=expression(paste("Relationship between ",PM[10]," and ",NO[X])), xlab=expression(paste(NO[X]," concentrations (",mu*g^-3,")")), ylab=expression(paste(PM[10]," concentrations (",mu*g^-3,")")))