EVOLUTION-MANAGER
Edit File: element.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: Theme elements</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 margin {ggplot2}"><tr><td>margin {ggplot2}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Theme elements</h2> <h3>Description</h3> <p>In conjunction with the <a href="theme.html">theme</a> system, the <code>element_</code> functions specify the display of how non-data components of the plot are drawn. </p> <ul> <li> <p><code>element_blank</code>: draws nothing, and assigns no space. </p> </li> <li> <p><code>element_rect</code>: borders and backgrounds. </p> </li> <li> <p><code>element_line</code>: lines. </p> </li> <li> <p><code>element_text</code>: text. </p> </li></ul> <p><code>rel()</code> is used to specify sizes relative to the parent, <code>margin()</code> is used to specify the margins of elements. </p> <h3>Usage</h3> <pre> margin(t = 0, r = 0, b = 0, l = 0, unit = "pt") element_blank() element_rect( fill = NULL, colour = NULL, size = NULL, linetype = NULL, color = NULL, inherit.blank = FALSE ) element_line( colour = NULL, size = NULL, linetype = NULL, lineend = NULL, color = NULL, arrow = NULL, inherit.blank = FALSE ) element_text( family = NULL, face = NULL, colour = NULL, size = NULL, hjust = NULL, vjust = NULL, angle = NULL, lineheight = NULL, color = NULL, margin = NULL, debug = NULL, inherit.blank = FALSE ) rel(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>t, r, b, l</code></td> <td> <p>Dimensions of each margin. (To remember order, think trouble).</p> </td></tr> <tr valign="top"><td><code>unit</code></td> <td> <p>Default units of dimensions. Defaults to "pt" so it can be most easily scaled with the text.</p> </td></tr> <tr valign="top"><td><code>fill</code></td> <td> <p>Fill colour.</p> </td></tr> <tr valign="top"><td><code>colour, color</code></td> <td> <p>Line/border colour. Color is an alias for colour.</p> </td></tr> <tr valign="top"><td><code>size</code></td> <td> <p>Line/border size in mm; text size in pts.</p> </td></tr> <tr valign="top"><td><code>linetype</code></td> <td> <p>Line type. An integer (0:8), a name (blank, solid, dashed, dotted, dotdash, longdash, twodash), or a string with an even number (up to eight) of hexadecimal digits which give the lengths in consecutive positions in the string.</p> </td></tr> <tr valign="top"><td><code>inherit.blank</code></td> <td> <p>Should this element inherit the existence of an <code>element_blank</code> among its parents? If <code>TRUE</code> the existence of a blank element among its parents will cause this element to be blank as well. If <code>FALSE</code> any blank parent element will be ignored when calculating final element state.</p> </td></tr> <tr valign="top"><td><code>lineend</code></td> <td> <p>Line end Line end style (round, butt, square)</p> </td></tr> <tr valign="top"><td><code>arrow</code></td> <td> <p>Arrow specification, as created by <code><a href="../../grid/html/arrow.html">grid::arrow()</a></code></p> </td></tr> <tr valign="top"><td><code>family</code></td> <td> <p>Font family</p> </td></tr> <tr valign="top"><td><code>face</code></td> <td> <p>Font face ("plain", "italic", "bold", "bold.italic")</p> </td></tr> <tr valign="top"><td><code>hjust</code></td> <td> <p>Horizontal justification (in <i>[0, 1]</i>)</p> </td></tr> <tr valign="top"><td><code>vjust</code></td> <td> <p>Vertical justification (in <i>[0, 1]</i>)</p> </td></tr> <tr valign="top"><td><code>angle</code></td> <td> <p>Angle (in <i>[0, 360]</i>)</p> </td></tr> <tr valign="top"><td><code>lineheight</code></td> <td> <p>Line height</p> </td></tr> <tr valign="top"><td><code>margin</code></td> <td> <p>Margins around the text. See <code><a href="element.html">margin()</a></code> for more details. When creating a theme, the margins should be placed on the side of the text facing towards the center of the plot.</p> </td></tr> <tr valign="top"><td><code>debug</code></td> <td> <p>If <code>TRUE</code>, aids visual debugging by drawing a solid rectangle behind the complete text area, and a point where each label is anchored.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>A single number specifying size relative to parent element.</p> </td></tr> </table> <h3>Value</h3> <p>An S3 object of class <code>element</code>, <code>rel</code>, or <code>margin</code>. </p> <h3>Examples</h3> <pre> plot <- ggplot(mpg, aes(displ, hwy)) + geom_point() plot + theme( panel.background = element_blank(), axis.text = element_blank() ) plot + theme( axis.text = element_text(colour = "red", size = rel(1.5)) ) plot + theme( axis.line = element_line(arrow = arrow()) ) plot + theme( panel.background = element_rect(fill = "white"), plot.margin = margin(2, 2, 2, 2, "cm"), plot.background = element_rect( fill = "grey90", colour = "black", size = 1 ) ) </pre> <hr /><div style="text-align: center;">[Package <em>ggplot2</em> version 3.3.2 <a href="00Index.html">Index</a>]</div> </body></html>