EVOLUTION-MANAGER
Edit File: n2mfrow.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: Compute Default mfrow From Number of Plots</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 n2mfrow {grDevices}"><tr><td>n2mfrow {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute Default mfrow From Number of Plots</h2> <h3>Description</h3> <p>Easy setup for plotting multiple figures (in a rectangular layout) on one page. This computes a sensible default for <code><a href="../../graphics/html/par.html">par</a>(mfrow)</code>. </p> <h3>Usage</h3> <pre> n2mfrow(nr.plots) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>nr.plots</code></td> <td> <p>integer; the number of plot figures you'll want to draw.</p> </td></tr> </table> <h3>Value</h3> <p>A length two integer vector <code>nr, nc</code> giving the number of rows and columns, fulfilling <code>nr >= nc >= 1</code> and <code>nr * nc >= nr.plots</code>. </p> <h3>Author(s)</h3> <p>Martin Maechler</p> <h3>See Also</h3> <p><code><a href="../../graphics/html/par.html">par</a></code>, <code><a href="../../graphics/html/layout.html">layout</a></code>.</p> <h3>Examples</h3> <pre> require(graphics) n2mfrow(8) # 3 x 3 n <- 5 ; x <- seq(-2, 2, len = 51) ## suppose now that 'n' is not known {inside function} op <- par(mfrow = n2mfrow(n)) for (j in 1:n) plot(x, x^j, main = substitute(x^ exp, list(exp = j)), type = "l", col = "blue") sapply(1:10, n2mfrow) </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>