EVOLUTION-MANAGER
Edit File: gtable_matrix.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: Create a gtable from a matrix of grobs.</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 gtable_matrix {gtable}"><tr><td>gtable_matrix {gtable}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a gtable from a matrix of grobs.</h2> <h3>Description</h3> <p>This function takes a matrix of grobs and create a gtable matching with the grobs in the same position as they were in the matrix, with the given heights and widths. </p> <h3>Usage</h3> <pre> gtable_matrix(name, grobs, widths = NULL, heights = NULL, z = NULL, respect = FALSE, clip = "on", vp = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>a string giving the name of the table. This is used to name the layout viewport</p> </td></tr> <tr valign="top"><td><code>grobs</code></td> <td> <p>a single grob or a list of grobs</p> </td></tr> <tr valign="top"><td><code>widths</code></td> <td> <p>a unit vector giving the width of each column</p> </td></tr> <tr valign="top"><td><code>heights</code></td> <td> <p>a unit vector giving the height of each row</p> </td></tr> <tr valign="top"><td><code>z</code></td> <td> <p>a numeric matrix of the same dimensions as <code>grobs</code>, specifying the order that the grobs are drawn.</p> </td></tr> <tr valign="top"><td><code>respect</code></td> <td> <p>a logical vector of length 1: should the aspect ratio of height and width specified in null units be respected. See <code><a href="../../grid/html/grid.layout.html">grid.layout()</a></code> for more details</p> </td></tr> <tr valign="top"><td><code>clip</code></td> <td> <p>should drawing be clipped to the specified cells (<code>"on"</code>), the entire table (<code>"inherit"</code>), or not at all (<code>"off"</code>)</p> </td></tr> <tr valign="top"><td><code>vp</code></td> <td> <p>a grid viewport object (or NULL).</p> </td></tr> </table> <h3>Value</h3> <p>A gtable of the same dimensions as the grobs matrix. </p> <h3>See Also</h3> <p>Other gtable construction: <code><a href="gtable_col.html">gtable_col</a></code>, <code><a href="gtable_row.html">gtable_row</a></code>, <code><a href="gtable_spacer.html">gtable_spacer</a></code>, <code><a href="gtable.html">gtable</a></code> </p> <h3>Examples</h3> <pre> library(grid) a <- rectGrob(gp = gpar(fill = "red")) b <- circleGrob() c <- linesGrob() row <- matrix(list(a, b, c), nrow = 1) col <- matrix(list(a, b, c), ncol = 1) mat <- matrix(list(a, b, c, nullGrob()), nrow = 2) gtable_matrix("demo", row, unit(c(1, 1, 1), "null"), unit(1, "null")) gtable_matrix("demo", col, unit(1, "null"), unit(c(1, 1, 1), "null")) gtable_matrix("demo", mat, unit(c(1, 1), "null"), unit(c(1, 1), "null")) # Can specify z ordering z <- matrix(c(3, 1, 2, 4), nrow = 2) gtable_matrix("demo", mat, unit(c(1, 1), "null"), unit(c(1, 1), "null"), z = z) </pre> <hr /><div style="text-align: center;">[Package <em>gtable</em> version 0.3.0 <a href="00Index.html">Index</a>]</div> </body></html>