The outer margin of a plot can be used to place some text. The function mtext puts text in the bottom, left, top or right margin, according to the value set in the side parameter.
plot(1,2)
mtext(„text at bottom“, side = 1)
mtext(„text at left“, side = 2)
mtext(„text at top“, side = 3)
mtext(„text at right“, side = 4)
In the actual graph the text is very close to the axis. You can move it away from the axis by using the line parameter. The text is moved to the according margin line. Counting starts with zero and goes outwards, away from the axis.
plot(1,2)
mtext(„top 0“, side = 3, line = 0)
mtext(„top 1“, side = 3, line = 1)
mtext(„top 2“, side = 3, line = 2)
mtext(„top 3“, side = 3, line = 3)