Adding mathematical and scientific notations (typesetting)

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.

Getting ready

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")

How to do it...

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: ...

Get R: Data Analysis and Visualization now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.