EVOLUTION-MANAGER
Edit File: title.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Plot Annotation</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for title {graphics}"><tr><td>title {graphics}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Plot Annotation</h2> <h3>Description</h3> <p>This function can be used to add labels to a plot. Its first four principal arguments can also be used as arguments in most high-level plotting functions. They must be of type <code><a href="../../base/html/character.html">character</a></code> or <code><a href="../../base/html/expression.html">expression</a></code>. In the latter case, quite a bit of mathematical notation is available such as sub- and superscripts, greek letters, fractions, etc: see <a href="../../grDevices/html/plotmath.html">plotmath</a> </p> <h3>Usage</h3> <pre> title(main = NULL, sub = NULL, xlab = NULL, ylab = NULL, line = NA, outer = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>main</code></td> <td> <p>The main title (on top) using font, size (character expansion) and color <code>par(c("font.main", "cex.main", "col.main"))</code>.</p> </td></tr> <tr valign="top"><td><code>sub</code></td> <td> <p>Sub-title (at bottom) using font, size and color <code>par(c("font.sub", "cex.sub", "col.sub"))</code>.</p> </td></tr> <tr valign="top"><td><code>xlab</code></td> <td> <p>X axis label using font, size and color <code>par(c("font.lab", "cex.lab", "col.lab"))</code>.</p> </td></tr> <tr valign="top"><td><code>ylab</code></td> <td> <p>Y axis label, same font attributes as <code>xlab</code>.</p> </td></tr> <tr valign="top"><td><code>line</code></td> <td> <p>specifying a value for <code>line</code> overrides the default placement of labels, and places them this many lines outwards from the plot edge.</p> </td></tr> <tr valign="top"><td><code>outer</code></td> <td> <p>a logical value. If <code>TRUE</code>, the titles are placed in the outer margins of the plot.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further <a href="par.html">graphical parameters</a> from <code><a href="par.html">par</a></code>. Use e.g., <code>col.main</code> or <code>cex.sub</code> instead of just <code>col</code> or <code>cex</code>. <code>adj</code> controls the justification of the titles. <code>xpd</code> can be used to set the clipping region: this defaults to the figure region unless <code>outer = TRUE</code>, otherwise the device region and can only be increased. <code>mgp</code> controls the default placing of the axis titles. </p> </td></tr> </table> <h3>Details</h3> <p>The labels passed to <code>title</code> can be character strings or language objects (names, calls or expressions), or a list containing the string to be plotted, and a selection of the optional modifying <a href="par.html">graphical parameters</a> <code>cex=</code>, <code>col=</code> and <code>font=</code>. Other objects will be coerced by <code><a href="../../grDevices/html/as.graphicsAnnot.html">as.graphicsAnnot</a></code>. </p> <p>The position of <code>main</code> defaults to being vertically centered in (outer) margin 3 and justified horizontally according to <code>par("adj")</code> on the plot region (device region for <code>outer = TRUE</code>). </p> <p>The positions of <code>xlab</code>, <code>ylab</code> and <code>sub</code> are <code>line</code> (default for <code>xlab</code> and <code>ylab</code> being <code>par("mgp")[1]</code> and increased by <code>1</code> for <code>sub</code>) lines (of height <code>par("mex")</code>) into the appropriate margin, justified in the text direction according to <code>par("adj")</code> on the plot/device region. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="mtext.html">mtext</a></code>, <code><a href="text.html">text</a></code>; <code><a href="../../grDevices/html/plotmath.html">plotmath</a></code> for details on mathematical annotation. </p> <h3>Examples</h3> <pre> plot(cars, main = "") # here, could use main directly title(main = "Stopping Distance versus Speed") plot(cars, main = "") title(main = list("Stopping Distance versus Speed", cex = 1.5, col = "red", font = 3)) ## Specifying "..." : plot(1, col.axis = "sky blue", col.lab = "thistle") title("Main Title", sub = "sub title", cex.main = 2, font.main= 4, col.main= "blue", cex.sub = 0.75, font.sub = 3, col.sub = "red") x <- seq(-4, 4, len = 101) y <- cbind(sin(x), cos(x)) matplot(x, y, type = "l", xaxt = "n", main = expression(paste(plain(sin) * phi, " and ", plain(cos) * phi)), ylab = expression("sin" * phi, "cos" * phi), # only 1st is taken xlab = expression(paste("Phase Angle ", phi)), col.main = "blue") axis(1, at = c(-pi, -pi/2, 0, pi/2, pi), labels = expression(-pi, -pi/2, 0, pi/2, pi)) abline(h = 0, v = pi/2 * c(-1,1), lty = 2, lwd = .1, col = "gray70") </pre> <hr /><div style="text-align: center;">[Package <em>graphics</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>