<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>
<codeclass="descclassname">cmocean.tools.</code><codeclass="descname">crop_by_percent</code><spanclass="sig-paren">(</span><em>cmap</em>, <em>per</em>, <em>which='both'</em>, <em>N=None</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.tools.crop_by_percent" title="Permalink to this definition">¶</a></dt>
<dd><p>Crop end or ends of a colormap by per percent.</p>
<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.lighten">
<codeclass="descclassname">cmocean.tools.</code><codeclass="descname">lighten</code><spanclass="sig-paren">(</span><em>cmapin</em>, <em>alpha</em><spanclass="sig-paren">)</span><aclass="headerlink" href="#cmocean.tools.lighten" title="Permalink to this definition">¶</a></dt>
<dd><p>Lighten a colormap by adding alpha < 1.</p>
<trclass="field-odd field"><thclass="field-name">Parameters:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>cmap</strong> – A colormap object, like cmocean.cm.matter.</li>
<li><strong>alpha</strong> – An alpha or transparency value to assign the colormap. Alpha
of 1 is opaque and of 1 is fully transparent.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Outputs resultant colormap object.</p>
<dlclass="docutils">
<dt>This will lighten the appearance of a plot you make using the output</dt>
<dd>colormap object. It is also possible to lighten many plots in the
plotting function itself (e.g. pcolormesh or contourf).</dd>
</dl>
</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>