forked from matplotlib/matplotlib.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmocean.html
More file actions
229 lines (203 loc) · 10.6 KB
/
Copy pathcmocean.html
File metadata and controls
229 lines (203 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cmocean package — cmocean 0.02 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.02',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="cmocean 0.02 documentation" href="index.html" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="cmocean-package">
<h1>cmocean package<a class="headerlink" href="#cmocean-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="cmocean-cmocean-module">
<h2>cmocean.cmocean module<a class="headerlink" href="#cmocean-cmocean-module" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-cmocean.plots">
<span id="cmocean-plots-module"></span><h2>cmocean.plots module<a class="headerlink" href="#module-cmocean.plots" title="Permalink to this headline">¶</a></h2>
<p>Plots with colormaps.</p>
<dl class="function">
<dt id="cmocean.plots.plot_gallery">
<code class="descclassname">cmocean.plots.</code><code class="descname">plot_gallery</code><span class="sig-paren">(</span><em>saveplot=False</em><span class="sig-paren">)</span><a class="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
gallery.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>saveplot=False</strong> – Whether to save the plot or not.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="cmocean.plots.plot_lightness">
<code class="descclassname">cmocean.plots.</code><code class="descname">plot_lightness</code><span class="sig-paren">(</span><em>saveplot=False</em><span class="sig-paren">)</span><a class="headerlink" href="#cmocean.plots.plot_lightness" title="Permalink to this definition">¶</a></dt>
<dd><p>Plot lightness of colormaps together.</p>
</dd></dl>
<dl class="function">
<dt id="cmocean.plots.quick_plot">
<code class="descclassname">cmocean.plots.</code><code class="descname">quick_plot</code><span class="sig-paren">(</span><em>cmap</em>, <em>fname=None</em>, <em>fig=None</em>, <em>ax=None</em>, <em>N=10</em><span class="sig-paren">)</span><a class="headerlink" href="#cmocean.plots.quick_plot" title="Permalink to this definition">¶</a></dt>
<dd><p>Show quick test of a colormap.</p>
</dd></dl>
<dl class="function">
<dt id="cmocean.plots.test">
<code class="descclassname">cmocean.plots.</code><code class="descname">test</code><span class="sig-paren">(</span><em>cmap</em>, <em>fig=None</em>, <em>ax=None</em><span class="sig-paren">)</span><a class="headerlink" href="#cmocean.plots.test" title="Permalink to this definition">¶</a></dt>
<dd><p>Test colormap by plotting.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cmap</strong> – A colormap instance. Use a named one with cm.get_cmap(colormap)</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="cmocean.plots.wrap_viscm">
<code class="descclassname">cmocean.plots.</code><code class="descname">wrap_viscm</code><span class="sig-paren">(</span><em>cmap</em>, <em>dpi=100</em>, <em>saveplot=False</em><span class="sig-paren">)</span><a class="headerlink" href="#cmocean.plots.wrap_viscm" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate goodness of colormap using perceptual deltas.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cmap</strong> – Colormap instance.</li>
<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>
<div class="section" id="module-cmocean.tools">
<span id="cmocean-tools-module"></span><h2>cmocean.tools module<a class="headerlink" href="#module-cmocean.tools" title="Permalink to this headline">¶</a></h2>
<p>Plot up stuff with colormaps.</p>
<dl class="function">
<dt id="cmocean.tools.cmap">
<code class="descclassname">cmocean.tools.</code><code class="descname">cmap</code><span class="sig-paren">(</span><em>rgbin</em>, <em>N=256</em><span class="sig-paren">)</span><a class="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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="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>
<dl class="function">
<dt id="cmocean.tools.get_dict">
<code class="descclassname">cmocean.tools.</code><code class="descname">get_dict</code><span class="sig-paren">(</span><em>cmap</em>, <em>N=256</em><span class="sig-paren">)</span><a class="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 <a class="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 <a class="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>
<dl class="function">
<dt id="cmocean.tools.print_colormaps">
<code class="descclassname">cmocean.tools.</code><code class="descname">print_colormaps</code><span class="sig-paren">(</span><em>cmaps</em>, <em>N=256</em>, <em>returnrgb=True</em>, <em>savefiles=False</em><span class="sig-paren">)</span><a class="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>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="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>
<div class="section" id="module-cmocean">
<span id="module-contents"></span><h2>Module contents<a class="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>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">cmocean package</a><ul>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#cmocean-cmocean-module">cmocean.cmocean module</a></li>
<li><a class="reference internal" href="#module-cmocean.plots">cmocean.plots module</a></li>
<li><a class="reference internal" href="#module-cmocean.tools">cmocean.tools module</a></li>
<li><a class="reference internal" href="#module-cmocean">Module contents</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/cmocean.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2015, Kristen Thyng.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.3.3</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.7</a>
|
<a href="_sources/cmocean.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>