EVOLUTION-MANAGER
Edit File: plot.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: Generic X-Y Plotting</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 plot {graphics}"><tr><td>plot {graphics}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Generic X-Y Plotting</h2> <h3>Description</h3> <p>Generic function for plotting of <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects. For more details about the graphical parameter arguments, see <code><a href="par.html">par</a></code>. </p> <p>For simple scatter plots, <code><a href="plot.default.html">plot.default</a></code> will be used. However, there are <code>plot</code> methods for many <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> objects, including <code><a href="../../base/html/function.html">function</a></code>s, <code><a href="../../base/html/data.frame.html">data.frame</a></code>s, <code><a href="../../stats/html/density.html">density</a></code> objects, etc. Use <code>methods(plot)</code> and the documentation for these. </p> <h3>Usage</h3> <pre> plot(x, y, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>the coordinates of points in the plot. Alternatively, a single plotting structure, function or <em>any <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object with a <code>plot</code> method</em> can be provided.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>the y coordinates of points in the plot, <em>optional</em> if <code>x</code> is an appropriate structure.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Arguments to be passed to methods, such as <a href="par.html">graphical parameters</a> (see <code><a href="par.html">par</a></code>). Many methods will accept the following arguments: </p> <dl> <dt><code>type</code></dt><dd><p>what type of plot should be drawn. Possible types are </p> <ul> <li> <p><code>"p"</code> for <b>p</b>oints, </p> </li> <li> <p><code>"l"</code> for <b>l</b>ines, </p> </li> <li> <p><code>"b"</code> for <b>b</b>oth, </p> </li> <li> <p><code>"c"</code> for the lines part alone of <code>"b"</code>, </p> </li> <li> <p><code>"o"</code> for both ‘<b>o</b>verplotted’, </p> </li> <li> <p><code>"h"</code> for ‘<b>h</b>istogram’ like (or ‘high-density’) vertical lines, </p> </li> <li> <p><code>"s"</code> for stair <b>s</b>teps, </p> </li> <li> <p><code>"S"</code> for other <b>s</b>teps, see ‘Details’ below, </p> </li> <li> <p><code>"n"</code> for no plotting. </p> </li></ul> <p>All other <code>type</code>s give a warning or an error; using, e.g., <code>type = "punkte"</code> being equivalent to <code>type = "p"</code> for S compatibility. Note that some methods, e.g. <code><a href="plot.factor.html">plot.factor</a></code>, do not accept this. </p> </dd> <dt><code>main</code></dt><dd><p>an overall title for the plot: see <code><a href="title.html">title</a></code>.</p> </dd> <dt><code>sub</code></dt><dd><p>a sub title for the plot: see <code><a href="title.html">title</a></code>.</p> </dd> <dt><code>xlab</code></dt><dd><p>a title for the x axis: see <code><a href="title.html">title</a></code>.</p> </dd> <dt><code>ylab</code></dt><dd><p>a title for the y axis: see <code><a href="title.html">title</a></code>.</p> </dd> <dt><code>asp</code></dt><dd><p>the <i>y/x</i> aspect ratio, see <code><a href="plot.window.html">plot.window</a></code>.</p> </dd> </dl> </td></tr> </table> <h3>Details</h3> <p>The two step types differ in their x-y preference: Going from <i>(x1,y1)</i> to <i>(x2,y2)</i> with <i>x1 < x2</i>, <code>type = "s"</code> moves first horizontal, then vertical, whereas <code>type = "S"</code> moves the other way around. </p> <h3>See Also</h3> <p><code><a href="plot.default.html">plot.default</a></code>, <code><a href="plot.formula.html">plot.formula</a></code> and other methods; <code><a href="points.html">points</a></code>, <code><a href="lines.html">lines</a></code>, <code><a href="par.html">par</a></code>. For thousands of points, consider using <code><a href="smoothScatter.html">smoothScatter</a>()</code> instead of <code>plot()</code>. </p> <p>For X-Y-Z plotting see <code><a href="contour.html">contour</a></code>, <code><a href="persp.html">persp</a></code> and <code><a href="image.html">image</a></code>. </p> <h3>Examples</h3> <pre> require(stats) # for lowess, rpois, rnorm plot(cars) lines(lowess(cars)) plot(sin, -pi, 2*pi) # see ?plot.function ## Discrete Distribution Plot: plot(table(rpois(100, 5)), type = "h", col = "red", lwd = 10, main = "rpois(100, lambda = 5)") ## Simple quantiles/ECDF, see ecdf() {library(stats)} for a better one: plot(x <- sort(rnorm(47)), type = "s", main = "plot(x, type = \"s\")") points(x, cex = .5, col = "dark red") </pre> <hr /><div style="text-align: center;">[Package <em>graphics</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>