<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><title>Draw a Palette, Leaving Margins Suitable for an Accompanying Plot — drawPalette • oce</title><script src="../deps/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"><link href="../deps/bootstrap-5.3.1/bootstrap.min.css" rel="stylesheet"><script src="../deps/bootstrap-5.3.1/bootstrap.bundle.min.js"></script><link href="../deps/font-awesome-6.4.2/css/all.min.css" rel="stylesheet"><link href="../deps/font-awesome-6.4.2/css/v4-shims.min.css" rel="stylesheet"><script src="../deps/headroom-0.11.0/headroom.min.js"></script><script src="../deps/headroom-0.11.0/jQuery.headroom.min.js"></script><script src="../deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js"></script><script src="../deps/clipboard.js-2.0.11/clipboard.min.js"></script><script src="../deps/search-1.0.0/autocomplete.jquery.min.js"></script><script src="../deps/search-1.0.0/fuse.min.js"></script><script src="../deps/search-1.0.0/mark.min.js"></script><!-- pkgdown --><script src="../pkgdown.js"></script><meta property="og:title" content="Draw a Palette, Leaving Margins Suitable for an Accompanying Plot — drawPalette"><meta name="description" content="In the normal use, drawPalette() draws an image palette near the
right-hand side of the plotting device, and then adjusts the global margin
settings in such a way as to cause the next plot to appear (with much larger
width) to the left of the palette. The function can also be used, if
zlim is not provided, to adjust the margin without drawing anything;
this is useful in lining up the x axes of a stack of plots, some some of
which will have palettes and others not."><meta property="og:description" content="In the normal use, drawPalette() draws an image palette near the
right-hand side of the plotting device, and then adjusts the global margin
settings in such a way as to cause the next plot to appear (with much larger
width) to the left of the palette. The function can also be used, if
zlim is not provided, to adjust the margin without drawing anything;
this is useful in lining up the x axes of a stack of plots, some some of
which will have palettes and others not."></head><body>
    <a href="#main" class="visually-hidden-focusable">Skip to contents</a>


    <nav class="navbar navbar-expand-lg fixed-top bg-light" data-bs-theme="light" aria-label="Site navigation"><div class="container">

    <a class="navbar-brand me-2" href="../index.html">oce</a>

    <small class="nav-text text-muted me-auto" data-bs-toggle="tooltip" data-bs-placement="bottom" title="">1.8-4</small>


    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

    <div id="navbar" class="collapse navbar-collapse ms-3">
      <ul class="navbar-nav me-auto"><li class="active nav-item"><a class="nav-link" href="../reference/index.html">Reference</a></li>
<li class="nav-item dropdown">
  <button class="nav-link dropdown-toggle" type="button" id="dropdown-articles" data-bs-toggle="dropdown" aria-expanded="false" aria-haspopup="true">Articles</button>
  <ul class="dropdown-menu" aria-labelledby="dropdown-articles"><li><a class="dropdown-item" href="../articles/A_oce.html">1. Introduction to Oce</a></li>
    <li><a class="dropdown-item" href="../articles/B_ctd.html">2. Analysis of CTD data</a></li>
    <li><a class="dropdown-item" href="../articles/C_adp.html">3. Analysis of acoustic-Doppler data</a></li>
    <li><a class="dropdown-item" href="../articles/D_map_projections.html">4. Using map projections</a></li>
    <li><a class="dropdown-item" href="../articles/E_flags.html">5. Dealing with data-quality flags</a></li>
    <li><a class="dropdown-item" href="../articles/F_subclassing.html">6. Subclassing oce objects</a></li>
    <li><a class="dropdown-item" href="../articles/G_altering_defaults.html">7. Altering oce Defaults</a></li>
    <li><a class="dropdown-item" href="../articles/H_tides.html">8. Tidal Analysis</a></li>
  </ul></li>
<li class="nav-item"><a class="nav-link" href="../news/index.html">Changelog</a></li>
      </ul><ul class="navbar-nav"><li class="nav-item"><form class="form-inline" role="search">
 <input class="form-control" type="search" name="search-input" id="search-input" autocomplete="off" aria-label="Search site" placeholder="Search for" data-search-index="../search.json"></form></li>
<li class="nav-item"><a class="external-link nav-link" href="https://github.com/dankelley/oce/" aria-label="GitHub"><span class="fa fab fa-github fa-lg"></span></a></li>
      </ul></div>


  </div>
</nav><div class="container template-reference-topic">
<div class="row">
  <main id="main" class="col-md-9"><div class="page-header">

      <h1>Draw a Palette, Leaving Margins Suitable for an Accompanying Plot</h1>
      <small class="dont-index">Source: <a href="https://github.com/dankelley/oce/blob/HEAD/R/imagep.R" class="external-link"><code>R/imagep.R</code></a></small>
      <div class="d-none name"><code>drawPalette.Rd</code></div>
    </div>

    <div class="ref-description section level2">
    <p>In the normal use, <code>drawPalette()</code> draws an image palette near the
right-hand side of the plotting device, and then adjusts the global margin
settings in such a way as to cause the next plot to appear (with much larger
width) to the left of the palette. The function can also be used, if
<code>zlim</code> is not provided, to adjust the margin without drawing anything;
this is useful in lining up the x axes of a stack of plots, some some of
which will have palettes and others not.</p>
    </div>

    <div class="section level2">
    <h2 id="ref-usage">Usage<a class="anchor" aria-label="anchor" href="#ref-usage"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span><span class="fu">drawPalette</span><span class="op">(</span></span>
<span>  <span class="va">zlim</span>,</span>
<span>  zlab <span class="op">=</span> <span class="st">""</span>,</span>
<span>  <span class="va">breaks</span>,</span>
<span>  <span class="va">col</span>,</span>
<span>  <span class="va">colormap</span>,</span>
<span>  <span class="va">mai</span>,</span>
<span>  cex <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span><span class="st">"cex"</span><span class="op">)</span>,</span>
<span>  pos <span class="op">=</span> <span class="fl">4</span>,</span>
<span>  las <span class="op">=</span> <span class="fl">0</span>,</span>
<span>  labels <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  at <span class="op">=</span> <span class="cn">NULL</span>,</span>
<span>  <span class="va">levels</span>,</span>
<span>  drawContours <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  plot <span class="op">=</span> <span class="cn">TRUE</span>,</span>
<span>  fullpage <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  drawTriangles <span class="op">=</span> <span class="cn">FALSE</span>,</span>
<span>  <span class="va">axisPalette</span>,</span>
<span>  <span class="va">tformat</span>,</span>
<span>  debug <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"oceDebug"</span><span class="op">)</span>,</span>
<span>  <span class="va">...</span></span>
<span><span class="op">)</span></span></code></pre></div>
    </div>

    <div class="section level2">
    <h2 id="arguments">Arguments<a class="anchor" aria-label="anchor" href="#arguments"></a></h2>


<dl><dt id="arg-zlim">zlim<a class="anchor" aria-label="anchor" href="#arg-zlim"></a></dt>
<dd><p>two-element vector containing the lower and upper limits of z.
This may also be a vector of any length exceeding 1, in which case its range
is used.</p></dd>


<dt id="arg-zlab">zlab<a class="anchor" aria-label="anchor" href="#arg-zlab"></a></dt>
<dd><p>label for the palette scale.</p></dd>


<dt id="arg-breaks">breaks<a class="anchor" aria-label="anchor" href="#arg-breaks"></a></dt>
<dd><p>optional numeric vector of the z values for breaks in the color scheme.
If <code>colormap</code> is provided, it takes precedence over <code>breaks</code> and <code>col</code>.</p></dd>


<dt id="arg-col">col<a class="anchor" aria-label="anchor" href="#arg-col"></a></dt>
<dd><p>optional argument, either a vector of colors corresponding to the breaks, of length
1 less than the number of breaks, or a function specifying colors.
If <code>col</code> is not provided, and if <code>colormap</code> is also not provided, then <code>col</code>
defaults to <code><a href="oceColorsViridis.html">oceColorsViridis()</a></code>.
If <code>colormap</code> is provided, it takes precedence over <code>breaks</code> and <code>col</code>.</p></dd>


<dt id="arg-colormap">colormap<a class="anchor" aria-label="anchor" href="#arg-colormap"></a></dt>
<dd><p>an optional color map as created by <code><a href="colormap.html">colormap()</a></code>.
If <code>colormap</code> is provided, it takes precedence over <code>breaks</code> and <code>col</code>.</p></dd>


<dt id="arg-mai">mai<a class="anchor" aria-label="anchor" href="#arg-mai"></a></dt>
<dd><p>margins for palette, as defined in the usual way; see
<code><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par()</a></code>.  If not given, reasonable values are inferred from the
existence of a non-blank <code>zlab</code>.</p></dd>


<dt id="arg-cex">cex<a class="anchor" aria-label="anchor" href="#arg-cex"></a></dt>
<dd><p>numeric character expansion value for text labels</p></dd>


<dt id="arg-pos">pos<a class="anchor" aria-label="anchor" href="#arg-pos"></a></dt>
<dd><p>an integer indicating the location of the palette within the
plotting area, 1 for near the bottom, 2 for near the left-hand side, 3 for
near the top side, and 4 (the default) for near the right-hand side.</p></dd>


<dt id="arg-las">las<a class="anchor" aria-label="anchor" href="#arg-las"></a></dt>
<dd><p>optional argument, passed to <code><a href="https://rdrr.io/r/graphics/axis.html" class="external-link">axis()</a></code>, to control the orientation
of numbers along the axis. As explained in the help for <code><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par()</a></code>, the
meaning of <code>las</code> is as follows: <code>las=0</code> (the default) means to put labels
parallel to the axis, <code>las=1</code> means horizontal (regardless of
axis orientation), <code>las=2</code> means perpendicular to the axis,
and <code>las=3</code> means to vertical (regardless of axis orientation).  Note that
the automatic computation of margin spacing parameter <code>mai</code>
assumes that <code>las=0</code>, and so for other cases, the user may need to
specify the <code>mai</code> argument directly.</p></dd>


<dt id="arg-labels">labels<a class="anchor" aria-label="anchor" href="#arg-labels"></a></dt>
<dd><p>optional vector of labels for ticks on palette axis (must
correspond with <code>at</code>)</p></dd>


<dt id="arg-at">at<a class="anchor" aria-label="anchor" href="#arg-at"></a></dt>
<dd><p>optional vector of positions for the <code>label</code>s</p></dd>


<dt id="arg-levels">levels<a class="anchor" aria-label="anchor" href="#arg-levels"></a></dt>
<dd><p>optional contour levels, in preference to <code>breaks</code>
values, to be added to the image if <code>drawContours</code> is <code>TRUE</code>.</p></dd>


<dt id="arg-drawcontours">drawContours<a class="anchor" aria-label="anchor" href="#arg-drawcontours"></a></dt>
<dd><p>logical value indicating whether to draw contours on the
palette, at the color breaks.</p></dd>


<dt id="arg-plot">plot<a class="anchor" aria-label="anchor" href="#arg-plot"></a></dt>
<dd><p>logical value indicating whether to plot the palette, the
default, or whether to just alter the margins to make space for where the
palette would have gone.  The latter case may be useful in lining up plots,
as in example 1 of “Examples”.</p></dd>


<dt id="arg-fullpage">fullpage<a class="anchor" aria-label="anchor" href="#arg-fullpage"></a></dt>
<dd><p>logical value indicating whether to draw the palette filling
the whole plot width (apart from <code>mai</code>, of course).  This can be
helpful if the palette panel is to be created with <code><a href="https://rdrr.io/r/graphics/layout.html" class="external-link">layout()</a></code>, as
illustrated in the “Examples”.</p></dd>


<dt id="arg-drawtriangles">drawTriangles<a class="anchor" aria-label="anchor" href="#arg-drawtriangles"></a></dt>
<dd><p>logical value indicating whether to draw triangles on
the top and bottom of the palette.  If a single value is provided, it applies
to both ends of the palette.  If a pair is provided, the first refers to the
lower range of the palette, and the second to the upper range.</p></dd>


<dt id="arg-axispalette">axisPalette<a class="anchor" aria-label="anchor" href="#arg-axispalette"></a></dt>
<dd><p>optional replacement function for <code><a href="https://rdrr.io/r/graphics/axis.html" class="external-link">axis()</a></code>, e.g.
for exponential notation on large or small values.</p></dd>


<dt id="arg-tformat">tformat<a class="anchor" aria-label="anchor" href="#arg-tformat"></a></dt>
<dd><p>optional format for axis labels, if the variable is a time
type (ignored otherwise).</p></dd>


<dt id="arg-debug">debug<a class="anchor" aria-label="anchor" href="#arg-debug"></a></dt>
<dd><p>a flag that turns on debugging.  Set to 1 to get a moderate
amount of debugging information, or to 2 to get more.</p></dd>


<dt id="arg--">...<a class="anchor" aria-label="anchor" href="#arg--"></a></dt>
<dd><p>optional arguments passed to plotting functions.</p></dd>

</dl></div>
    <div class="section level2">
    <h2 id="value">Value<a class="anchor" aria-label="anchor" href="#value"></a></h2>
    <p>None.</p>
    </div>
    <div class="section level2">
    <h2 id="details">Details<a class="anchor" aria-label="anchor" href="#details"></a></h2>
    <p>The plot positioning is done entirely with margins, not with
<code>par(mfrow)</code> or other R schemes for multi-panel plots.  This means that
the user is free to use those schemes without worrying about nesting or
conflicts.</p>
    </div>
    <div class="section level2">
    <h2 id="use-with-multi-panel-plots">Use with multi-panel plots<a class="anchor" aria-label="anchor" href="#use-with-multi-panel-plots"></a></h2>
    <p>An important consequence of the margin
adjustment is that multi-panel plots require that the initial margin be
stored prior to the first call to <code>drawPalette()</code>, and reset after each
palette-plot pair.  This method is illustrated in “Examples”.</p>
    </div>
    <div class="section level2">
    <h2 id="see-also">See also<a class="anchor" aria-label="anchor" href="#see-also"></a></h2>
    <div class="dont-index"><p>This is used by <code><a href="imagep.html">imagep()</a></code>.</p></div>
    </div>
    <div class="section level2">
    <h2 id="author">Author<a class="anchor" aria-label="anchor" href="#author"></a></h2>
    <p>Dan Kelley, with help from Clark Richards</p>
    </div>

    <div class="section level2">
    <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
    <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span></span></span>
<span class="r-in"><span><span class="kw"><a href="https://rdrr.io/r/base/library.html" class="external-link">library</a></span><span class="op">(</span><span class="va"><a href="https://dankelley.github.io/oce/">oce</a></span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mgp <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/options.html" class="external-link">getOption</a></span><span class="op">(</span><span class="st">"oceMgp"</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># 1. A three-panel plot</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mfrow <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">3</span>, <span class="fl">1</span><span class="op">)</span>, mar <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">3</span>, <span class="fl">3</span>, <span class="fl">1</span>, <span class="fl">1</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">omar</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span><span class="st">"mar"</span><span class="op">)</span> <span class="co"># save initial margin</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># 1a. top panel: simple case with Viridis scheme</span></span></span>
<span class="r-in"><span><span class="fu">drawPalette</span><span class="op">(</span>zlim <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">0</span>, <span class="fl">1</span><span class="op">)</span>, col <span class="op">=</span> <span class="fu"><a href="oceColorsViridis.html">oce.colorsViridis</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span>, <span class="fl">1</span><span class="op">:</span><span class="fl">10</span>, col <span class="op">=</span> <span class="fu"><a href="oceColorsViridis.html">oce.colorsViridis</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>, pch <span class="op">=</span> <span class="fl">20</span>, cex <span class="op">=</span> <span class="fl">3</span>, xlab <span class="op">=</span> <span class="st">"x"</span>, ylab <span class="op">=</span> <span class="st">"y"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mar <span class="op">=</span> <span class="va">omar</span><span class="op">)</span> <span class="co"># reset margin</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># 1b. middle panel: colormap</span></span></span>
<span class="r-in"><span><span class="va">cm</span> <span class="op">&lt;-</span> <span class="fu"><a href="colormap.html">colormap</a></span><span class="op">(</span>name <span class="op">=</span> <span class="st">"gmt_globe"</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu">drawPalette</span><span class="op">(</span>colormap <span class="op">=</span> <span class="va">cm</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="va">icol</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/seq.html" class="external-link">seq_along</a></span><span class="op">(</span><span class="va">cm</span><span class="op">$</span><span class="va">col</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="va">icol</span>, <span class="va">cm</span><span class="op">$</span><span class="va">breaks</span><span class="op">[</span><span class="va">icol</span><span class="op">]</span>,</span></span>
<span class="r-in"><span>    pch <span class="op">=</span> <span class="fl">20</span>, cex <span class="op">=</span> <span class="fl">2</span>, col <span class="op">=</span> <span class="va">cm</span><span class="op">$</span><span class="va">col</span>,</span></span>
<span class="r-in"><span>    xlab <span class="op">=</span> <span class="st">"Palette index"</span>, ylab <span class="op">=</span> <span class="st">"Palette breaks"</span></span></span>
<span class="r-in"><span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mar <span class="op">=</span> <span class="va">omar</span><span class="op">)</span> <span class="co"># reset margin</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># 1c. bottom panel: space for palette (to line up graphs)</span></span></span>
<span class="r-in"><span><span class="fu">drawPalette</span><span class="op">(</span>plot <span class="op">=</span> <span class="cn">FALSE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/plot.default.html" class="external-link">plot</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span>, <span class="fl">1</span><span class="op">:</span><span class="fl">10</span>, col <span class="op">=</span> <span class="fu"><a href="oceColorsViridis.html">oce.colorsViridis</a></span><span class="op">(</span><span class="fl">10</span><span class="op">)</span><span class="op">[</span><span class="fl">1</span><span class="op">:</span><span class="fl">10</span><span class="op">]</span>, pch <span class="op">=</span> <span class="fl">20</span>, cex <span class="op">=</span> <span class="fl">3</span>, xlab <span class="op">=</span> <span class="st">"x"</span>, ylab <span class="op">=</span> <span class="st">"y"</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="drawPalette-1.png" alt="" width="700" height="700"></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/par.html" class="external-link">par</a></span><span class="op">(</span>mar <span class="op">=</span> <span class="va">omar</span><span class="op">)</span> <span class="co"># reset margin</span></span></span>
<span class="r-in"><span></span></span>
<span class="r-in"><span><span class="co"># 2. Use layout to mimic the action of imagep(), with the width</span></span></span>
<span class="r-in"><span><span class="co"># of the palette region being 14 percent of figure width.</span></span></span>
<span class="r-in"><span><span class="va">d</span> <span class="op">&lt;-</span> <span class="fl">0.14</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/layout.html" class="external-link">layout</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/matrix.html" class="external-link">matrix</a></span><span class="op">(</span><span class="fl">1</span><span class="op">:</span><span class="fl">2</span>, nrow <span class="op">=</span> <span class="fl">1</span><span class="op">)</span>, widths <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">1</span> <span class="op">-</span> <span class="va">d</span>, <span class="va">d</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/image.html" class="external-link">image</a></span><span class="op">(</span><span class="va">volcano</span>, col <span class="op">=</span> <span class="fu"><a href="oceColorsViridis.html">oce.colorsViridis</a></span><span class="op">(</span><span class="fl">100</span><span class="op">)</span>, zlim <span class="op">=</span> <span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">90</span>, <span class="fl">200</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu"><a href="https://rdrr.io/r/graphics/contour.html" class="external-link">contour</a></span><span class="op">(</span><span class="va">volcano</span>, add <span class="op">=</span> <span class="cn">TRUE</span><span class="op">)</span></span></span>
<span class="r-in"><span><span class="fu">drawPalette</span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/c.html" class="external-link">c</a></span><span class="op">(</span><span class="fl">90</span>, <span class="fl">200</span><span class="op">)</span>, fullpage <span class="op">=</span> <span class="cn">TRUE</span>, col <span class="op">=</span> <span class="va">oce.colorsViridis</span><span class="op">)</span></span></span>
<span class="r-plt img"><img src="drawPalette-2.png" alt="" width="700" height="700"></span>
</code></pre></div>
    </div>
  </main><aside class="col-md-3"><nav id="toc" aria-label="Table of contents"><h2>On this page</h2>
    </nav></aside></div>


    <footer><div class="pkgdown-footer-left">
  <p>Developed by Dan Kelley, Clark Richards.</p>
</div>

<div class="pkgdown-footer-right">
  <p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.1.0.9000.</p>
</div>

    </footer></div>





  </body></html>

