EVOLUTION-MANAGER
Edit File: guide_coloursteps.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: Discretized colourbar guide</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 guide_coloursteps {ggplot2}"><tr><td>guide_coloursteps {ggplot2}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Discretized colourbar guide</h2> <h3>Description</h3> <p>This guide is version of <code><a href="guide_colourbar.html">guide_colourbar()</a></code> for binned colour and fill scales. It shows areas between breaks as a single constant colour instead of the gradient known from the colourbar counterpart. </p> <h3>Usage</h3> <pre> guide_coloursteps(even.steps = TRUE, show.limits = NULL, ticks = FALSE, ...) guide_colorsteps(even.steps = TRUE, show.limits = NULL, ticks = FALSE, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>even.steps</code></td> <td> <p>Should the rendered size of the bins be equal, or should they be proportional to their length in the data space? Defaults to <code>TRUE</code></p> </td></tr> <tr valign="top"><td><code>show.limits</code></td> <td> <p>Should labels for the outer limits of the bins be printed? Default is <code>NULL</code> which makes the guide use the setting from the scale</p> </td></tr> <tr valign="top"><td><code>ticks</code></td> <td> <p>A logical specifying if tick marks on the colourbar should be visible.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Arguments passed on to <code><a href="guide_colourbar.html">guide_colourbar</a></code> </p> <dl> <dt><code>barwidth</code></dt><dd><p>A numeric or a <code><a href="../../grid/html/unit.html">grid::unit()</a></code> object specifying the width of the colourbar. Default value is <code>legend.key.width</code> or <code>legend.key.size</code> in <code><a href="theme.html">theme()</a></code> or theme.</p> </dd> <dt><code>barheight</code></dt><dd><p>A numeric or a <code><a href="../../grid/html/unit.html">grid::unit()</a></code> object specifying the height of the colourbar. Default value is <code>legend.key.height</code> or <code>legend.key.size</code> in <code><a href="theme.html">theme()</a></code> or theme.</p> </dd> <dt><code>frame.colour</code></dt><dd><p>A string specifying the colour of the frame drawn around the bar. If <code>NULL</code> (the default), no frame is drawn.</p> </dd> <dt><code>frame.linewidth</code></dt><dd><p>A numeric specifying the width of the frame drawn around the bar.</p> </dd> <dt><code>frame.linetype</code></dt><dd><p>A numeric specifying the linetype of the frame drawn around the bar.</p> </dd> <dt><code>ticks.colour</code></dt><dd><p>A string specifying the colour of the tick marks.</p> </dd> <dt><code>ticks.linewidth</code></dt><dd><p>A numeric specifying the width of the tick marks.</p> </dd> <dt><code>draw.ulim</code></dt><dd><p>A logical specifying if the upper limit tick marks should be visible.</p> </dd> <dt><code>draw.llim</code></dt><dd><p>A logical specifying if the lower limit tick marks should be visible.</p> </dd> <dt><code>direction</code></dt><dd><p>A character string indicating the direction of the guide. One of "horizontal" or "vertical."</p> </dd> <dt><code>default.unit</code></dt><dd><p>A character string indicating <code><a href="../../grid/html/unit.html">grid::unit()</a></code> for <code>barwidth</code> and <code>barheight</code>.</p> </dd> <dt><code>reverse</code></dt><dd><p>logical. If <code>TRUE</code> the colourbar is reversed. By default, the highest value is on the top and the lowest value is on the bottom</p> </dd> <dt><code>title</code></dt><dd><p>A character string or expression indicating a title of guide. If <code>NULL</code>, the title is not shown. By default (<code><a href="waiver.html">waiver()</a></code>), the name of the scale object or the name specified in <code><a href="labs.html">labs()</a></code> is used for the title.</p> </dd> <dt><code>title.position</code></dt><dd><p>A character string indicating the position of a title. One of "top" (default for a vertical guide), "bottom", "left" (default for a horizontal guide), or "right."</p> </dd> <dt><code>title.theme</code></dt><dd><p>A theme object for rendering the title text. Usually the object of <code><a href="element.html">element_text()</a></code> is expected. By default, the theme is specified by <code>legend.title</code> in <code><a href="theme.html">theme()</a></code> or theme.</p> </dd> <dt><code>title.hjust</code></dt><dd><p>A number specifying horizontal justification of the title text.</p> </dd> <dt><code>title.vjust</code></dt><dd><p>A number specifying vertical justification of the title text.</p> </dd> <dt><code>label</code></dt><dd><p>logical. If <code>TRUE</code> then the labels are drawn. If <code>FALSE</code> then the labels are invisible.</p> </dd> <dt><code>label.position</code></dt><dd><p>A character string indicating the position of a label. One of "top", "bottom" (default for horizontal guide), "left", or "right" (default for vertical guide).</p> </dd> <dt><code>label.theme</code></dt><dd><p>A theme object for rendering the label text. Usually the object of <code><a href="element.html">element_text()</a></code> is expected. By default, the theme is specified by <code>legend.text</code> in <code><a href="theme.html">theme()</a></code>.</p> </dd> <dt><code>label.hjust</code></dt><dd><p>A numeric specifying horizontal justification of the label text.</p> </dd> <dt><code>label.vjust</code></dt><dd><p>A numeric specifying vertical justification of the label text.</p> </dd> <dt><code>order</code></dt><dd><p>positive integer less than 99 that specifies the order of this guide among multiple guides. This controls the order in which multiple guides are displayed, not the contents of the guide itself. If 0 (default), the order is determined by a secret algorithm.</p> </dd> </dl> </td></tr> </table> <h3>Value</h3> <p>A guide object </p> <h3>Use with discrete scale</h3> <p>This guide is intended to show binned data and work together with ggplot2's binning scales. However, it is sometimes desirable to perform the binning in a separate step, either as part of a stat (e.g. <code><a href="geom_contour.html">stat_contour_filled()</a></code>) or prior to the visualisation. If you want to use this guide for discrete data the levels must follow the naming scheme implemented by <code><a href="../../base/html/cut.html">base::cut()</a></code>. This means that a bin must be encoded as <code>"(<lower>, <upper>]"</code> with <code style="white-space: pre;"><lower></code> giving the lower bound of the bin and <code style="white-space: pre;"><upper></code> giving the upper bound (<code>"[<lower>, <upper>)"</code> is also accepted). If you use <code><a href="../../base/html/cut.html">base::cut()</a></code> to perform the binning everything should work as expected, if not, some recoding may be needed. </p> <h3>See Also</h3> <p>Other guides: <code><a href="guide_bins.html">guide_bins</a>()</code>, <code><a href="guide_colourbar.html">guide_colourbar</a>()</code>, <code><a href="guide_legend.html">guide_legend</a>()</code>, <code><a href="guides.html">guides</a>()</code> </p> <h3>Examples</h3> <pre> df <- expand.grid(X1 = 1:10, X2 = 1:10) df$value <- df$X1 * df$X2 p <- ggplot(df, aes(X1, X2)) + geom_tile(aes(fill = value)) # Coloursteps guide is the default for binned colour scales p + scale_fill_binned() # By default each bin in the guide is the same size irrespectively of how # their sizes relate in data space p + scale_fill_binned(breaks = c(10, 25, 50)) # This can be changed with the `even.steps` argument p + scale_fill_binned( breaks = c(10, 25, 50), guide = guide_coloursteps(even.steps = FALSE) ) # By default the limits is not shown, but this can be changed p + scale_fill_binned(guide = guide_coloursteps(show.limits = TRUE)) # (can also be set in the scale) p + scale_fill_binned(show.limits = TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>ggplot2</em> version 3.3.2 <a href="00Index.html">Index</a>]</div> </body></html>