EVOLUTION-MANAGER
Edit File: sunflowerplot.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: Produce a Sunflower Scatter Plot</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 sunflowerplot {graphics}"><tr><td>sunflowerplot {graphics}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Produce a Sunflower Scatter Plot</h2> <h3>Description</h3> <p>Multiple points are plotted as ‘sunflowers’ with multiple leaves (‘petals’) such that overplotting is visualized instead of accidental and invisible. </p> <h3>Usage</h3> <pre> sunflowerplot(x, ...) ## Default S3 method: sunflowerplot(x, y = NULL, number, log = "", digits = 6, xlab = NULL, ylab = NULL, xlim = NULL, ylim = NULL, add = FALSE, rotate = FALSE, pch = 16, cex = 0.8, cex.fact = 1.5, col = par("col"), bg = NA, size = 1/8, seg.col = 2, seg.lwd = 1.5, ...) ## S3 method for class 'formula' sunflowerplot(formula, data = NULL, xlab = NULL, ylab = NULL, ..., subset, na.action = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>numeric vector of <code>x</code>-coordinates of length <code>n</code>, say, or another valid plotting structure, as for <code><a href="plot.default.html">plot.default</a></code>, see also <code><a href="../../grDevices/html/xy.coords.html">xy.coords</a></code>.</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>numeric vector of <code>y</code>-coordinates of length <code>n</code>.</p> </td></tr> <tr valign="top"><td><code>number</code></td> <td> <p>integer vector of length <code>n</code>. <code>number[i]</code> = number of replicates for <code>(x[i], y[i])</code>, may be 0.<br /> Default (<code>missing(number)</code>): compute the exact multiplicity of the points <code>x[], y[]</code>, via <code><a href="../../grDevices/html/xyTable.html">xyTable</a>()</code>.</p> </td></tr> <tr valign="top"><td><code>log</code></td> <td> <p>character indicating log coordinate scale, see <code><a href="plot.default.html">plot.default</a></code>.</p> </td></tr> <tr valign="top"><td><code>digits</code></td> <td> <p>when <code>number</code> is computed (i.e., not specified), <code>x</code> and <code>y</code> are rounded to <code>digits</code> significant digits before multiplicities are computed.</p> </td></tr> <tr valign="top"><td><code>xlab, ylab</code></td> <td> <p>character label for x-, or y-axis, respectively.</p> </td></tr> <tr valign="top"><td><code>xlim, ylim</code></td> <td> <p><code>numeric(2)</code> limiting the extents of the x-, or y-axis.</p> </td></tr> <tr valign="top"><td><code>add</code></td> <td> <p>logical; should the plot be added on a previous one ? Default is <code>FALSE</code>.</p> </td></tr> <tr valign="top"><td><code>rotate</code></td> <td> <p>logical; if <code>TRUE</code>, randomly rotate the sunflowers (preventing artefacts).</p> </td></tr> <tr valign="top"><td><code>pch</code></td> <td> <p>plotting character to be used for points (<code>number[i]==1</code>) and center of sunflowers.</p> </td></tr> <tr valign="top"><td><code>cex</code></td> <td> <p>numeric; character size expansion of center points (s. <code>pch</code>).</p> </td></tr> <tr valign="top"><td><code>cex.fact</code></td> <td> <p>numeric <em>shrinking</em> factor to be used for the center points <em>when there are flower leaves</em>, i.e., <code>cex / cex.fact</code> is used for these.</p> </td></tr> <tr valign="top"><td><code>col, bg</code></td> <td> <p>colors for the plot symbols, passed to <code><a href="plot.default.html">plot.default</a></code>.</p> </td></tr> <tr valign="top"><td><code>size</code></td> <td> <p>of sunflower leaves in inches, 1[in] := 2.54[cm]. Default: 1/8\", approximately 3.2mm.</p> </td></tr> <tr valign="top"><td><code>seg.col</code></td> <td> <p>color to be used for the <b>seg</b>ments which make the sunflowers leaves, see <code><a href="par.html">par</a>(col=)</code>; <code>col = "gold"</code> reminds of real sunflowers.</p> </td></tr> <tr valign="top"><td><code>seg.lwd</code></td> <td> <p>numeric; the line width for the leaves' segments.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments to <code><a href="plot.html">plot</a></code> [if <code>add = FALSE</code>], or to be passed to or from another method.</p> </td></tr> <tr valign="top"><td><code>formula</code></td> <td> <p>a <code><a href="../../stats/html/formula.html">formula</a></code>, such as <code>y ~ x</code>.</p> </td></tr> <tr valign="top"><td><code>data</code></td> <td> <p>a data.frame (or list) from which the variables in <code>formula</code> should be taken.</p> </td></tr> <tr valign="top"><td><code>subset</code></td> <td> <p>an optional vector specifying a subset of observations to be used in the fitting process.</p> </td></tr> <tr valign="top"><td><code>na.action</code></td> <td> <p>a function which indicates what should happen when the data contain <code>NA</code>s. The default is to ignore case with missing values.</p> </td></tr> </table> <h3>Details</h3> <p>This is a generic function with default and formula methods. </p> <p>For <code>number[i] == 1</code>, a (slightly enlarged) usual plotting symbol (<code>pch</code>) is drawn. For <code>number[i] > 1</code>, a small plotting symbol is drawn and <code>number[i]</code> equi-angular ‘rays’ emanate from it. </p> <p>If <code>rotate = TRUE</code> and <code>number[i] >= 2</code>, a random direction is chosen (instead of the y-axis) for the first ray. The goal is to <code><a href="../../base/html/jitter.html">jitter</a></code> the orientations of the sunflowers in order to prevent artefactual visual impressions. </p> <h3>Value</h3> <p>A list with three components of same length, </p> <table summary="R valueblock"> <tr valign="top"><td><code>x</code></td> <td> <p>x coordinates</p> </td></tr> <tr valign="top"><td><code>y</code></td> <td> <p>y coordinates</p> </td></tr> <tr valign="top"><td><code>number</code></td> <td> <p>number</p> </td></tr> </table> <p>Use <code><a href="../../grDevices/html/xyTable.html">xyTable</a>()</code> (from package <span class="pkg">grDevices</span>) if you are only interested in this return value. </p> <h3>Side Effects</h3> <p>A scatter plot is drawn with ‘sunflowers’ as symbols. </p> <h3>Author(s)</h3> <p>Andreas Ruckstuhl, Werner Stahel, Martin Maechler, Tim Hesterberg, 1989–1993. Port to <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> by Martin Maechler <a href="mailto:maechler@stat.math.ethz.ch">maechler@stat.math.ethz.ch</a>. </p> <h3>References</h3> <p>Chambers, J. M., Cleveland, W. S., Kleiner, B. and Tukey, P. A. (1983). <em>Graphical Methods for Data Analysis</em>. Wadsworth. </p> <p>Schilling, M. F. and Watkins, A. E. (1994). A suggestion for sunflower plots. <em>The American Statistician</em>, <b>48</b>, 303–305. doi: <a href="https://doi.org/10.2307/2684839">10.2307/2684839</a>. </p> <p>Murrell, P. (2005). <em>R Graphics</em>. Chapman & Hall/CRC Press. </p> <h3>See Also</h3> <p><code><a href="../../stats/html/density.html">density</a></code>, <code><a href="../../grDevices/html/xyTable.html">xyTable</a></code> </p> <h3>Examples</h3> <pre> require(stats) # for rnorm require(grDevices) ## 'number' is computed automatically: sunflowerplot(iris[, 3:4]) ## Imitating Chambers et al, p.109, closely: sunflowerplot(iris[, 3:4], cex = .2, cex.fact = 1, size = .035, seg.lwd = .8) ## or sunflowerplot(Petal.Width ~ Petal.Length, data = iris, cex = .2, cex.fact = 1, size = .035, seg.lwd = .8) sunflowerplot(x = sort(2*round(rnorm(100))), y = round(rnorm(100), 0), main = "Sunflower Plot of Rounded N(0,1)") ## Similarly using a "xyTable" argument: xyT <- xyTable(x = sort(2*round(rnorm(100))), y = round(rnorm(100), 0), digits = 3) utils::str(xyT, vec.len = 20) sunflowerplot(xyT, main = "2nd Sunflower Plot of Rounded N(0,1)") ## A 'marked point process' {explicit 'number' argument}: sunflowerplot(rnorm(100), rnorm(100), number = rpois(n = 100, lambda = 2), main = "Sunflower plot (marked point process)", rotate = TRUE, col = "blue4") </pre> <hr /><div style="text-align: center;">[Package <em>graphics</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>