Answer: Use the title() function to add title and axis labels to a plot.
title(main="main title", sub="sub-title", xlab="x-axis label", ylab="y-axis label")
Graphical parameters (such as text size, font, rotation, and color) can also be specified
in the title() function. For example, the following produces a red title and a blue
subtitle, and creates green x and y labels that are 25 percent smaller than the default
text size:
title(main="My Title", col.main="red",
sub="My Sub-title", col.sub="blue",
xlab="My X label", ylab="My Y label",
col.lab="green", cex.lab=0.75)
Asked In: Many Interviews |
Alert Moderator