EVOLUTION-MANAGER
Edit File: plothistogram.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 Histograms</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.histogram {graphics}"><tr><td>plot.histogram {graphics}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Plot Histograms</h2> <h3>Description</h3> <p>These are methods for objects of class <code>"histogram"</code>, typically produced by <code><a href="hist.html">hist</a></code>. </p> <h3>Usage</h3> <pre> ## S3 method for class 'histogram' plot(x, freq = equidist, density = NULL, angle = 45, col = NULL, border = par("fg"), lty = NULL, main = paste("Histogram of", paste(x$xname, collapse = "\n")), sub = NULL, xlab = x$xname, ylab, xlim = range(x$breaks), ylim = NULL, axes = TRUE, labels = FALSE, add = FALSE, ann = TRUE, ...) ## S3 method for class 'histogram' lines(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a <code>histogram</code> object, or a list with components <code>density</code>, <code>mid</code>, etc, see <code><a href="hist.html">hist</a></code> for information about the components of <code>x</code>.</p> </td></tr> <tr valign="top"><td><code>freq</code></td> <td> <p>logical; if <code>TRUE</code>, the histogram graphic is to present a representation of frequencies, i.e, <code>x$counts</code>; if <code>FALSE</code>, <em>relative</em> frequencies (probabilities), i.e., <code>x$density</code>, are plotted. The default is true for equidistant <code>breaks</code> and false otherwise.</p> </td></tr> <tr valign="top"><td><code>col</code></td> <td> <p>a colour to be used to fill the bars. The default of <code>NULL</code> yields unfilled bars.</p> </td></tr> <tr valign="top"><td><code>border</code></td> <td> <p>the color of the border around the bars.</p> </td></tr> <tr valign="top"><td><code>angle, density</code></td> <td> <p>select shading of bars by lines: see <code><a href="rect.html">rect</a></code>.</p> </td></tr> <tr valign="top"><td><code>lty</code></td> <td> <p>the line type used for the bars, see also <code><a href="lines.html">lines</a></code>.</p> </td></tr> <tr valign="top"><td><code>main, sub, xlab, ylab</code></td> <td> <p>these arguments to <code>title</code> have useful defaults here.</p> </td></tr> <tr valign="top"><td><code>xlim, ylim</code></td> <td> <p>the range of x and y values with sensible defaults.</p> </td></tr> <tr valign="top"><td><code>axes</code></td> <td> <p>logical, indicating if axes should be drawn.</p> </td></tr> <tr valign="top"><td><code>labels</code></td> <td> <p>logical or character. Additionally draw labels on top of bars, if not <code>FALSE</code>; if <code>TRUE</code>, draw the counts or rounded densities; if <code>labels</code> is a <code>character</code>, draw itself.</p> </td></tr> <tr valign="top"><td><code>add</code></td> <td> <p>logical. If <code>TRUE</code>, only the bars are added to the current plot. This is what <code>lines.histogram(*)</code> does.</p> </td></tr> <tr valign="top"><td><code>ann</code></td> <td> <p>logical. Should annotations (titles and axis titles) be plotted?</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further <a href="par.html">graphical parameters</a> to <code>title</code> and <code>axis</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>lines.histogram(*)</code> is the same as <code>plot.histogram(*, add = TRUE)</code>. </p> <h3>See Also</h3> <p><code><a href="hist.html">hist</a></code>, <code><a href="stem.html">stem</a></code>, <code><a href="../../stats/html/density.html">density</a></code>. </p> <h3>Examples</h3> <pre> (wwt <- hist(women$weight, nclass = 7, plot = FALSE)) plot(wwt, labels = TRUE) # default main & xlab using wwt$xname plot(wwt, border = "dark blue", col = "light blue", main = "Histogram of 15 women's weights", xlab = "weight [pounds]") ## Fake "lines" example, using non-default labels: w2 <- wwt; w2$counts <- w2$counts - 1 lines(w2, col = "Midnight Blue", labels = ifelse(w2$counts, "> 1", "1")) </pre> <hr /><div style="text-align: center;">[Package <em>graphics</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>