EVOLUTION-MANAGER
Edit File: scale_grey.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: Sequential grey colour scales</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 scale_colour_grey {ggplot2}"><tr><td>scale_colour_grey {ggplot2}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Sequential grey colour scales</h2> <h3>Description</h3> <p>Based on <code><a href="../../grDevices/html/gray.colors.html">gray.colors()</a></code>. This is black and white equivalent of <code><a href="scale_gradient.html">scale_colour_gradient()</a></code>. </p> <h3>Usage</h3> <pre> scale_colour_grey( ..., start = 0.2, end = 0.8, na.value = "red", aesthetics = "colour" ) scale_fill_grey( ..., start = 0.2, end = 0.8, na.value = "red", aesthetics = "fill" ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>...</code></td> <td> <p>Arguments passed on to <code><a href="discrete_scale.html">discrete_scale</a></code> </p> <dl> <dt><code>palette</code></dt><dd><p>A palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g., <code><a href="../../scales/html/hue_pal.html">scales::hue_pal()</a></code>).</p> </dd> <dt><code>breaks</code></dt><dd><p>One of: </p> <ul> <li> <p><code>NULL</code> for no breaks </p> </li> <li> <p><code>waiver()</code> for the default breaks (the scale limits) </p> </li> <li><p> A character vector of breaks </p> </li> <li><p> A function that takes the limits as input and returns breaks as output </p> </li></ul> </dd> <dt><code>limits</code></dt><dd><p>One of: </p> <ul> <li> <p><code>NULL</code> to use the default scale values </p> </li> <li><p> A character vector that defines possible values of the scale and their order </p> </li> <li><p> A function that accepts the existing (automatic) values and returns new ones </p> </li></ul> </dd> <dt><code>drop</code></dt><dd><p>Should unused factor levels be omitted from the scale? The default, <code>TRUE</code>, uses the levels that appear in the data; <code>FALSE</code> uses all the levels in the factor.</p> </dd> <dt><code>na.translate</code></dt><dd><p>Unlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify <code>na.translate = FALSE</code>.</p> </dd> <dt><code>scale_name</code></dt><dd><p>The name of the scale that should be used for error messages associated with this scale.</p> </dd> <dt><code>name</code></dt><dd><p>The name of the scale. Used as the axis or legend title. If <code>waiver()</code>, the default, the name of the scale is taken from the first mapping used for that aesthetic. If <code>NULL</code>, the legend title will be omitted.</p> </dd> <dt><code>labels</code></dt><dd><p>One of: </p> <ul> <li> <p><code>NULL</code> for no labels </p> </li> <li> <p><code>waiver()</code> for the default labels computed by the transformation object </p> </li> <li><p> A character vector giving labels (must be same length as <code>breaks</code>) </p> </li> <li><p> A function that takes the breaks as input and returns labels as output </p> </li></ul> </dd> <dt><code>expand</code></dt><dd><p>For position scales, a vector of range expansion constants used to add some padding around the data to ensure that they are placed some distance away from the axes. Use the convenience function <code><a href="expansion.html">expansion()</a></code> to generate the values for the <code>expand</code> argument. The defaults are to expand the scale by 5% on each side for continuous variables, and by 0.6 units on each side for discrete variables.</p> </dd> <dt><code>guide</code></dt><dd><p>A function used to create a guide or its name. See <code><a href="guides.html">guides()</a></code> for more information.</p> </dd> <dt><code>position</code></dt><dd><p>For position scales, The position of the axis. <code>left</code> or <code>right</code> for y axes, <code>top</code> or <code>bottom</code> for x axes.</p> </dd> <dt><code>super</code></dt><dd><p>The super class to use for the constructed scale</p> </dd> </dl> </td></tr> <tr valign="top"><td><code>start</code></td> <td> <p>grey value at low end of palette</p> </td></tr> <tr valign="top"><td><code>end</code></td> <td> <p>grey value at high end of palette</p> </td></tr> <tr valign="top"><td><code>na.value</code></td> <td> <p>Colour to use for missing values</p> </td></tr> <tr valign="top"><td><code>aesthetics</code></td> <td> <p>Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the <code>colour</code> and <code>fill</code> aesthetics at the same time, via <code>aesthetics = c("colour", "fill")</code>.</p> </td></tr> </table> <h3>See Also</h3> <p>Other colour scales: <code><a href="scale_alpha.html">scale_alpha</a>()</code>, <code><a href="scale_brewer.html">scale_colour_brewer</a>()</code>, <code><a href="scale_gradient.html">scale_colour_gradient</a>()</code>, <code><a href="scale_hue.html">scale_colour_hue</a>()</code>, <code><a href="scale_steps.html">scale_colour_steps</a>()</code>, <code><a href="scale_viridis.html">scale_colour_viridis_d</a>()</code> </p> <h3>Examples</h3> <pre> p <- ggplot(mtcars, aes(mpg, wt)) + geom_point(aes(colour = factor(cyl))) p + scale_colour_grey() p + scale_colour_grey(end = 0) # You may want to turn off the pale grey background with this scale p + scale_colour_grey() + theme_bw() # Colour of missing values is controlled with na.value: miss <- factor(sample(c(NA, 1:5), nrow(mtcars), replace = TRUE)) ggplot(mtcars, aes(mpg, wt)) + geom_point(aes(colour = miss)) + scale_colour_grey() ggplot(mtcars, aes(mpg, wt)) + geom_point(aes(colour = miss)) + scale_colour_grey(na.value = "green") </pre> <hr /><div style="text-align: center;">[Package <em>ggplot2</em> version 3.3.2 <a href="00Index.html">Index</a>]</div> </body></html>