Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b290a7

Browse files
committed
updated cmocean docs with new example image
1 parent 5927ba9 commit 0b290a7

28 files changed

+34
-53
lines changed

cmocean/_images/index-6.png

-1.26 KB
Loading

cmocean/_images/index-7.png

19.7 KB
Loading

cmocean/_images/index-8.png

-16.1 KB
Loading

cmocean/_images/index-9.png

-287 Bytes
Loading

cmocean/_sources/index.txt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ algae
165165

166166
The *algae* colormap is sequential with whitish-green for low values and increasing in green with increasing value, which could be used to represent an increase in chlorophyll in the water. Two examples of this colormap are shown below, from Texas A&M University gliders. This colormap is based on matplotlib's Greens, but was recreated from scratch using the viscm tool.
167167

168-
.. image:: http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_540/plots/sci_flbbcd_chlor_units.png
169-
:target: http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_540/plots/sci_flbbcd_chlor_units.png
170168
.. image:: http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_541/plots/sci_flbbcd_chlor_units.png
171169
:target: http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_541/plots/sci_flbbcd_chlor_units.png
172170

@@ -210,17 +208,10 @@ amp
210208

211209
The *amp* colormap is sequential from whitish to dark red and could be used to represent an increase in wave height values. This colormap is the positive half of the *balance* colormap.
212210

213-
.. plot::
214-
:include-source:
215-
216-
import cmocean
217-
import matplotlib.pyplot as plt
211+
.. figure:: https://cloud.githubusercontent.com/assets/3487237/16920916/840d91d4-4cdd-11e6-8db5-f93cd61b78c2.png
212+
:target: http://soliton.vm.bytemark.co.uk/pub/cpt-city/
218213

219-
fig = plt.figure(figsize=(8, 3))
220-
ax = fig.add_subplot(1, 2, 1)
221-
cmocean.plots.test(cmocean.cm.amp, ax=ax)
222-
ax = fig.add_subplot(1, 2, 2)
223-
cmocean.plots.quick_plot(cmocean.cm.amp, ax=ax)
214+
Earthquake magnitude, by `Natalie Accardo <http://www.natalieaccardo.com/>`_ using GMT.
224215

225216
tempo
226217
^^^^^

cmocean/index-1.pdf

0 Bytes
Binary file not shown.

cmocean/index-2.pdf

0 Bytes
Binary file not shown.

cmocean/index-3.pdf

0 Bytes
Binary file not shown.

cmocean/index-4.pdf

0 Bytes
Binary file not shown.

cmocean/index-5.pdf

0 Bytes
Binary file not shown.

cmocean/index-6.hires.png

-5.47 KB
Loading

cmocean/index-6.pdf

-148 Bytes
Binary file not shown.

cmocean/index-6.png

-1.26 KB
Loading

cmocean/index-6.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
fig = plt.figure(figsize=(8, 3))
55
ax = fig.add_subplot(1, 2, 1)
6-
cmocean.plots.test(cmocean.cm.amp, ax=ax)
6+
cmocean.plots.test(cmocean.cm.tempo, ax=ax)
77
ax = fig.add_subplot(1, 2, 2)
8-
cmocean.plots.quick_plot(cmocean.cm.amp, ax=ax)
8+
cmocean.plots.quick_plot(cmocean.cm.tempo, ax=ax)

cmocean/index-7.hires.png

54.6 KB
Loading

cmocean/index-7.pdf

443 KB
Binary file not shown.

cmocean/index-7.png

19.7 KB
Loading

cmocean/index-7.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import cmocean
22
import matplotlib.pyplot as plt
3+
import numpy as np
34

4-
fig = plt.figure(figsize=(8, 3))
5-
ax = fig.add_subplot(1, 2, 1)
6-
cmocean.plots.test(cmocean.cm.tempo, ax=ax)
7-
ax = fig.add_subplot(1, 2, 2)
8-
cmocean.plots.quick_plot(cmocean.cm.tempo, ax=ax)
5+
azimuths = np.arange(0, 361, 1)
6+
zeniths = np.arange(40, 70, 1)
7+
values = azimuths * np.ones((30, 361))
8+
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'))
9+
ax.pcolormesh(azimuths*np.pi/180.0, zeniths, values, cmap=cmocean.cm.phase)
10+
ax.set_yticks([])

cmocean/index-8.hires.png

-42.7 KB
Loading

cmocean/index-8.pdf

-443 KB
Binary file not shown.

cmocean/index-8.png

-16.1 KB
Loading

cmocean/index-8.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import cmocean
22
import matplotlib.pyplot as plt
3-
import numpy as np
43

5-
azimuths = np.arange(0, 361, 1)
6-
zeniths = np.arange(40, 70, 1)
7-
values = azimuths * np.ones((30, 361))
8-
fig, ax = plt.subplots(subplot_kw=dict(projection='polar'))
9-
ax.pcolormesh(azimuths*np.pi/180.0, zeniths, values, cmap=cmocean.cm.phase)
10-
ax.set_yticks([])
4+
fig = plt.figure(figsize=(8, 3))
5+
ax = fig.add_subplot(1, 2, 1)
6+
cmocean.plots.test(cmocean.cm.thermal, ax=ax)
7+
ax = fig.add_subplot(1, 2, 2)
8+
cmocean.plots.quick_plot(cmocean.cm.algae, ax=ax)

cmocean/index-9.hires.png

-177 Bytes
Loading

cmocean/index-9.pdf

-2.97 KB
Binary file not shown.

cmocean/index-9.png

-287 Bytes
Loading

cmocean/index-9.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
fig = plt.figure(figsize=(8, 3))
55
ax = fig.add_subplot(1, 2, 1)
6-
cmocean.plots.test(cmocean.cm.thermal, ax=ax)
6+
cmocean.plots.test(cmocean.cm.gray, ax=ax)
77
ax = fig.add_subplot(1, 2, 2)
8-
cmocean.plots.quick_plot(cmocean.cm.algae, ax=ax)
8+
cmocean.plots.test(cmocean.cm.gray_r, ax=ax)
9+
fig.tight_layout()

cmocean/index.html

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ <h3>dense<a class="headerlink" href="#dense" title="Permalink to this headline">
162162
<div class="section" id="algae">
163163
<h3>algae<a class="headerlink" href="#algae" title="Permalink to this headline"></a></h3>
164164
<p>The <em>algae</em> colormap is sequential with whitish-green for low values and increasing in green with increasing value, which could be used to represent an increase in chlorophyll in the water. Two examples of this colormap are shown below, from Texas A&amp;M University gliders. This colormap is based on matplotlib&#8217;s Greens, but was recreated from scratch using the viscm tool.</p>
165-
<a class="reference external image-reference" href="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_540/plots/sci_flbbcd_chlor_units.png"><img alt="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_540/plots/sci_flbbcd_chlor_units.png" src="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_540/plots/sci_flbbcd_chlor_units.png" /></a>
166165
<a class="reference external image-reference" href="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_541/plots/sci_flbbcd_chlor_units.png"><img alt="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_541/plots/sci_flbbcd_chlor_units.png" src="http://gcoos2.tamu.edu/gandalf_data/deployments/tamu/unit_541/plots/sci_flbbcd_chlor_units.png" /></a>
167166
</div>
168167
<div class="section" id="matter">
@@ -197,19 +196,9 @@ <h3>speed<a class="headerlink" href="#speed" title="Permalink to this headline">
197196
<div class="section" id="amp">
198197
<h3>amp<a class="headerlink" href="#amp" title="Permalink to this headline"></a></h3>
199198
<p>The <em>amp</em> colormap is sequential from whitish to dark red and could be used to represent an increase in wave height values. This colormap is the positive half of the <em>balance</em> colormap.</p>
200-
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">cmocean</span>
201-
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
202-
203-
<span class="n">fig</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">8</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span>
204-
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_subplot</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
205-
<span class="n">cmocean</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">test</span><span class="p">(</span><span class="n">cmocean</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">amp</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span>
206-
<span class="n">ax</span> <span class="o">=</span> <span class="n">fig</span><span class="o">.</span><span class="n">add_subplot</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
207-
<span class="n">cmocean</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">quick_plot</span><span class="p">(</span><span class="n">cmocean</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">amp</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span>
208-
</pre></div>
209-
</div>
210-
<p>(<a class="reference external" href=".//index-6.py">Source code</a>, <a class="reference external" href=".//index-6.png">png</a>, <a class="reference external" href=".//index-6.hires.png">hires.png</a>, <a class="reference external" href=".//index-6.pdf">pdf</a>)</p>
211-
<div class="figure">
212-
<img alt="_images/index-6.png" src="_images/index-6.png" />
199+
<div class="figure" id="id16">
200+
<a class="reference external image-reference" href="http://soliton.vm.bytemark.co.uk/pub/cpt-city/"><img alt="https://cloud.githubusercontent.com/assets/3487237/16920916/840d91d4-4cdd-11e6-8db5-f93cd61b78c2.png" src="https://cloud.githubusercontent.com/assets/3487237/16920916/840d91d4-4cdd-11e6-8db5-f93cd61b78c2.png" /></a>
201+
<p class="caption"><span class="caption-text">Earthquake magnitude, by <a class="reference external" href="http://www.natalieaccardo.com/">Natalie Accardo</a> using GMT.</span></p>
213202
</div>
214203
</div>
215204
<div class="section" id="tempo">
@@ -225,9 +214,9 @@ <h3>tempo<a class="headerlink" href="#tempo" title="Permalink to this headline">
225214
<span class="n">cmocean</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">quick_plot</span><span class="p">(</span><span class="n">cmocean</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">tempo</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span>
226215
</pre></div>
227216
</div>
228-
<p>(<a class="reference external" href=".//index-7.py">Source code</a>, <a class="reference external" href=".//index-7.png">png</a>, <a class="reference external" href=".//index-7.hires.png">hires.png</a>, <a class="reference external" href=".//index-7.pdf">pdf</a>)</p>
217+
<p>(<a class="reference external" href=".//index-6.py">Source code</a>, <a class="reference external" href=".//index-6.png">png</a>, <a class="reference external" href=".//index-6.hires.png">hires.png</a>, <a class="reference external" href=".//index-6.pdf">pdf</a>)</p>
229218
<div class="figure">
230-
<img alt="_images/index-7.png" src="_images/index-7.png" />
219+
<img alt="_images/index-6.png" src="_images/index-6.png" />
231220
</div>
232221
</div>
233222
<div class="section" id="phase">
@@ -245,9 +234,9 @@ <h3>phase<a class="headerlink" href="#phase" title="Permalink to this headline">
245234
<span class="n">ax</span><span class="o">.</span><span class="n">set_yticks</span><span class="p">([])</span>
246235
</pre></div>
247236
</div>
248-
<p>(<a class="reference external" href=".//index-8.py">Source code</a>, <a class="reference external" href=".//index-8.png">png</a>, <a class="reference external" href=".//index-8.hires.png">hires.png</a>, <a class="reference external" href=".//index-8.pdf">pdf</a>)</p>
237+
<p>(<a class="reference external" href=".//index-7.py">Source code</a>, <a class="reference external" href=".//index-7.png">png</a>, <a class="reference external" href=".//index-7.hires.png">hires.png</a>, <a class="reference external" href=".//index-7.pdf">pdf</a>)</p>
249238
<div class="figure">
250-
<img alt="_images/index-8.png" src="_images/index-8.png" />
239+
<img alt="_images/index-7.png" src="_images/index-7.png" />
251240
</div>
252241
</div>
253242
<div class="section" id="balance">
@@ -258,11 +247,11 @@ <h3>balance<a class="headerlink" href="#balance" title="Permalink to this headli
258247
<div class="section" id="delta">
259248
<h3>delta<a class="headerlink" href="#delta" title="Permalink to this headline"></a></h3>
260249
<p>The <em>delta</em> colormap is diverging from darker blues to just off-white through shades of yellow green and could be used to represent diverging velocity values around a critical value (usually zero). This colormap was inspired by <a class="reference external" href="http://www.francescasamsel.com/">Francesca Samsel&#8217;s</a> similar colormap, but generated from scratch using the viscm tool.</p>
261-
<div class="figure" id="id16">
250+
<div class="figure" id="id17">
262251
<a class="reference external image-reference" href="https://www.instagram.com/p/BGPoO-0Ryg8/"><img alt="https://pbs.twimg.com/media/CkIWDFRWkAEdArC.jpg" src="https://pbs.twimg.com/media/CkIWDFRWkAEdArC.jpg" /></a>
263252
<p class="caption"><span class="caption-text">From plotly.</span></p>
264253
</div>
265-
<div class="figure" id="id17">
254+
<div class="figure" id="id18">
266255
<a class="reference external image-reference" href="http://pong.tamu.edu/~kthyng/movies/txla_plots/u/2010.mp4"><img alt="http://pong.tamu.edu/~kthyng/movies/txla_plots/u/2010-07-30T00.png" src="http://pong.tamu.edu/~kthyng/movies/txla_plots/u/2010-07-30T00.png" /></a>
267256
<p class="caption"><span class="caption-text">Model output in the northwest Gulf of Mexico from the Physical Oceanography Numerical Group (PONG) at Texas A&amp;M.</span></p>
268257
</div>
@@ -286,9 +275,9 @@ <h2>Capabilities<a class="headerlink" href="#capabilities" title="Permalink to t
286275
<span class="n">cmocean</span><span class="o">.</span><span class="n">plots</span><span class="o">.</span><span class="n">quick_plot</span><span class="p">(</span><span class="n">cmocean</span><span class="o">.</span><span class="n">cm</span><span class="o">.</span><span class="n">algae</span><span class="p">,</span> <span class="n">ax</span><span class="o">=</span><span class="n">ax</span><span class="p">)</span>
287276
</pre></div>
288277
</div>
289-
<p>(<a class="reference external" href=".//index-9.py">Source code</a>, <a class="reference external" href=".//index-9.png">png</a>, <a class="reference external" href=".//index-9.hires.png">hires.png</a>, <a class="reference external" href=".//index-9.pdf">pdf</a>)</p>
278+
<p>(<a class="reference external" href=".//index-8.py">Source code</a>, <a class="reference external" href=".//index-8.png">png</a>, <a class="reference external" href=".//index-8.hires.png">hires.png</a>, <a class="reference external" href=".//index-8.pdf">pdf</a>)</p>
290279
<div class="figure">
291-
<img alt="_images/index-9.png" src="_images/index-9.png" />
280+
<img alt="_images/index-8.png" src="_images/index-8.png" />
292281
</div>
293282
<p>All available colormap names can be accessed with <code class="docutils literal"><span class="pre">cmocean.cm.cmapnames</span></code>:</p>
294283
<div class="highlight-ipython"><div class="highlight"><pre><span></span><span class="gp">In [1]: </span><span class="kn">import</span> <span class="nn">cmocean</span>
@@ -346,9 +335,9 @@ <h2>Capabilities<a class="headerlink" href="#capabilities" title="Permalink to t
346335
<span class="n">fig</span><span class="o">.</span><span class="n">tight_layout</span><span class="p">()</span>
347336
</pre></div>
348337
</div>
349-
<p>(<a class="reference external" href=".//index-10.py">Source code</a>, <a class="reference external" href=".//index-10.png">png</a>, <a class="reference external" href=".//index-10.hires.png">hires.png</a>, <a class="reference external" href=".//index-10.pdf">pdf</a>)</p>
338+
<p>(<a class="reference external" href=".//index-9.py">Source code</a>, <a class="reference external" href=".//index-9.png">png</a>, <a class="reference external" href=".//index-9.hires.png">hires.png</a>, <a class="reference external" href=".//index-9.pdf">pdf</a>)</p>
350339
<div class="figure">
351-
<img alt="_images/index-10.png" src="_images/index-10.png" />
340+
<img alt="_images/index-9.png" src="_images/index-9.png" />
352341
</div>
353342
</div>
354343
<div class="section" id="resources">

0 commit comments

Comments
 (0)