Plot Titling Information and/or Axis Labels

DESCRIPTION:

Adds titles and/or axis labels to the current plot.

USAGE:

title(main, sub, xlab, ylab, axes=F) 
axes(main, sub, xlab, ylab, axes=T) 

OPTIONAL ARGUMENTS:

main
character string for the main title, plotted on top in enlarged ( cex=1.5 times the current cex) characters.
sub
character string for the sub-title, plotted on the bottom below the x-axis title ( xlab).
xlab
character string to title the x-axis.
ylab
character string to title the y-axis.
axes
if TRUE, an enclosing box, tick marks and axis labels will be plotted.

Graphical parameters may also be supplied as arguments to this function (see ).

DETAILS:



title and axes rotate the text given by main, sub, xlab , and ylab to be parallel to the axes they are next to. (Thus they override the current value of the srt graphical parameter.) They use the current value of the adj graphical parameter to determine where along the axis to place this text: adj=0.5 centers the text at the center of the axis, adj=0 left justifies it to the left edge of the axis, and adj=1 right justifies it to the right edge of the axis.

You can specify the size, type, and color of the text for the main title, subtitle, axis labels, and tick mark labels by using arguments: cex.main , font.main, and col.main for the main title, cex.sub, font.sub, and col.sub for the subtitle, cex.lab, font.lab, and col.lab for the axis labels, and col.axis, font.axis, and col.axis for the tick mark labels, respectively.

title and axes rotate the tick mark labels to be parallel to the axes if the graphical parameter las is 0, horizontal if las is 1, and perpendicular to the axes if las is 2. (Again, this overrides the current value of srt.) The tick mark labels are centered at the tick mark if they are parallel to the axis and right or left justified if they are perpendicular to the axis and to the left or right of it, respectively. (This overrides the current value of adj.)

The mtext and text functions give you more flexibility in placing labels on a plot. The axis function gives you more flexibility in placing an axis on a plot.

SIDE EFFECTS:

text will be added to the current plot. The two functions differ only in the default value for axes. Nothing is plotted for arguments not supplied.

SEE ALSO:

, , , , .

EXAMPLES:

title("residuals from final fit") # main title only 
axes(xlab="concentration",ylab="temperature") 
tsplot(rain.nyc1) 
lines(lowess(rain.nyc1)) 
title(main="Rain in New York") 
# make two line title 
title(main="Monthly Precipitation \n in New York ")