<h1>cmocean package<aclass="headerlink" href="#cmocean-package" title="Permalink to this headline">¶</a></h1>
<divclass="section" id="submodules">
<h2>Submodules<aclass="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section" id="cmocean-cmocean-module">
<h2>cmocean.cmocean module<aclass="headerlink" href="#cmocean-cmocean-module" title="Permalink to this headline">¶</a></h2>
</div>
<divclass="section" id="module-cmocean.plots">
<spanid="cmocean-plots-module"></span><h2>cmocean.plots module<aclass="headerlink" href="#module-cmocean.plots" title="Permalink to this headline">¶</a></h2>
<p>Plots with colormaps.</p>
<dlclass="function">
<dtid="cmocean.plots.plot_gallery">
<codeclass="descclassname">cmocean.plots.</code><codeclass="descname">plot_gallery</code><spanclass="sig-paren">(</span><em>saveplot=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.plots.plot_gallery" title="Permalink to this definition">¶</a></dt>
<dd><p>Make plot of colormaps and labels, like in the matplotlib
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>saveplot=False</strong> – Whether to save the plot or not.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="cmocean.plots.plot_lightness">
<codeclass="descclassname">cmocean.plots.</code><codeclass="descname">plot_lightness</code><spanclass="sig-paren">(</span><em>saveplot=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.plots.plot_lightness" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot lightness of colormaps together.</p>
</dd></dl>
<dlclass="function">
<dtid="cmocean.plots.quick_plot">
<codeclass="descclassname">cmocean.plots.</code><codeclass="descname">quick_plot</code><spanclass="sig-paren">(</span><em>cmap</em>, <em>fname=None</em>, <em>fig=None</em>, <em>ax=None</em>, <em>N=10</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.plots.quick_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Show quick test of a colormap.</p>
</dd></dl>
<dlclass="function">
<dtid="cmocean.plots.test">
<codeclass="descclassname">cmocean.plots.</code><codeclass="descname">test</code><spanclass="sig-paren">(</span><em>cmap</em>, <em>fig=None</em>, <em>ax=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.plots.test" title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>cmap</strong> – A colormap instance. Use a named one with cm.get_cmap(colormap)</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="cmocean.plots.wrap_viscm">
<codeclass="descclassname">cmocean.plots.</code><codeclass="descname">wrap_viscm</code><spanclass="sig-paren">(</span><em>cmap</em>, <em>dpi=100</em>, <em>saveplot=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.plots.wrap_viscm" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate goodness of colormap using perceptual deltas.</p>
<li><strong>dpi=100</strong> – dpi for saved image.</li>
<li><strong>saveplot=False</strong> – Whether to save the plot or not.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<divclass="section" id="module-cmocean.tools">
<spanid="cmocean-tools-module"></span><h2>cmocean.tools module<aclass="headerlink" href="#module-cmocean.tools" title="Permalink to this headline">¶</a></h2>
<p>Plot up stuff with colormaps.</p>
<dlclass="function">
<dtid="cmocean.tools.cmap">
<codeclass="descclassname">cmocean.tools.</code><codeclass="descname">cmap</code><spanclass="sig-paren">(</span><em>rgbin</em>, <em>N=256</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.tools.cmap" title="Permalink to this definition">¶</a></dt>
<dd><p>Input an array of rgb values to generate a colormap.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>rgbin</strong> – An [mx3] array, where m is the number of input color triplets which
are interpolated between to make the colormap that is returned. hex values
can be input instead, as [mx1] in single quotes with a #.</li>
<li><strong>N=10</strong> – The number of levels to be interpolated to.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="cmocean.tools.get_dict">
<codeclass="descclassname">cmocean.tools.</code><codeclass="descname">get_dict</code><spanclass="sig-paren">(</span><em>cmap</em>, <em>N=256</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.tools.get_dict" title="Permalink to this definition">¶</a></dt>
<dd><p>Change from rgb to dictionary that LinearSegmentedColormap expects.
Code from <aclass="reference external" href="https://mycarta.wordpress.com/2014/04/25/convert-color-palettes-to-python-matplotlib-colormaps/">https://mycarta.wordpress.com/2014/04/25/convert-color-palettes-to-python-matplotlib-colormaps/</a>
and <aclass="reference external" href="http://nbviewer.ipython.org/github/kwinkunks/notebooks/blob/master/Matteo_colourmaps.ipynb">http://nbviewer.ipython.org/github/kwinkunks/notebooks/blob/master/Matteo_colourmaps.ipynb</a></p>
</dd></dl>
<dlclass="function">
<dtid="cmocean.tools.print_colormaps">
<codeclass="descclassname">cmocean.tools.</code><codeclass="descname">print_colormaps</code><spanclass="sig-paren">(</span><em>cmaps</em>, <em>N=256</em>, <em>returnrgb=True</em>, <em>savefiles=False</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.tools.print_colormaps" title="Permalink to this definition">¶</a></dt>
<dd><p>Print colormaps in 256 RGB colors to text files.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><strong>returnrgb=False</strong> – Whether or not to return the rgb array. Only makes sense to do if print one colormaps’ rgb.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<divclass="section" id="module-cmocean">
<spanid="module-contents"></span><h2>Module contents<aclass="headerlink" href="#module-cmocean" title="Permalink to this headline">¶</a></h2>
<p>cmocean is a package to help standardize colormaps for commonly-plotted
oceanographic properties.</p>
<p>See README.md for an overview on instructions.</p>