-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathcolorbar_api.html
More file actions
529 lines (482 loc) · 35.4 KB
/
colorbar_api.html
File metadata and controls
529 lines (482 loc) · 35.4 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!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>colorbar — Matplotlib 2.2.4 documentation</title>
<link rel="stylesheet" href="../_static/mpl.css"
type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css"
type="text/css" />
<link rel="stylesheet" href="../_static/graphviz.css" type="text/css" />
<link rel="stylesheet" href="../_static/gallery.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '2.2.4',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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>
<script type="text/javascript" src="../_static/language_data.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Matplotlib 2.2.4 documentation"
href="../_static/opensearch.xml"/>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html"
/>
<link rel="search" title="Search" href="../search.html"
/>
<link rel="top" title="Matplotlib 2.2.4 documentation" href="../index.html" />
<link rel="up" title="The Matplotlib API" href="index.html" />
<link rel="next" title="colors" href="colors_api.html" />
<link rel="prev" title="collections" href="collections_api.html" />
<link rel="canonical" href="https://matplotlib.org/stable/api/colorbar_api.html" />
<script data-domain="matplotlib.org" defer="defer" src="https://views.scientific-python.org/js/script.js"></script>
</head>
<body>
<div id="unreleased-message"> You are reading an old version of the documentation (v2.2.4). For the latest version see <a href="https://matplotlib.org/stable/api/colorbar_api.html">https://matplotlib.org/stable/api/colorbar_api.html</a></div>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
<a href="../index.html">
<div style="float: left; position: absolute; width: 496px; bottom: 0; padding-bottom: 24px"><span style="float: right; color: #789; background: white">Version 2.2.4</span></div>
<img src="../_static/logo2.png" height="125px" border="0" alt="matplotlib"/></a>
<!-- The "Fork me on github" ribbon -->
<div id="forkongithub"><a href="https://github.com/matplotlib/matplotlib">Fork me on GitHub</a></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="colors_api.html" title="colors"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="collections_api.html" title="collections"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">home</a>| </li>
<li><a href="../gallery/index.html">examples</a>| </li>
<li><a href="../tutorials/index.html">tutorials</a>| </li>
<li><a href="pyplot_summary.html">pyplot</a>| </li>
<li><a href="../contents.html">docs</a> »</li>
<li><a href="index.html" accesskey="U">The Matplotlib API</a> »</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<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>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
<h3><a href="../contents.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">colorbar</a><ul>
<li><a class="reference internal" href="#module-matplotlib.colorbar"><code class="docutils literal notranslate"><span class="pre">matplotlib.colorbar</span></code></a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="../contents.html">Documentation overview</a><ul>
<li><a href="index.html">The Matplotlib API</a><ul>
<li>Previous: <a href="collections_api.html" title="previous chapter">collections</a></li>
<li>Next: <a href="colors_api.html" title="next chapter">colors</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<div id="sidebar-pagesource" role="note" aria-label="source link"
style="margin-top: 1.5em; padding-top: 0.1em; border-top: 1px solid #86989b">
<a href="../_sources/api/colorbar_api.rst.txt"
style="color: #c0c0c0" rel="nofollow">Show Page Source</a>
</div>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="colorbar">
<h1>colorbar<a class="headerlink" href="#colorbar" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-matplotlib.colorbar">
<span id="matplotlib-colorbar"></span><h2><a class="reference internal" href="#module-matplotlib.colorbar" title="matplotlib.colorbar"><code class="xref py py-mod docutils literal notranslate"><span class="pre">matplotlib.colorbar</span></code></a><a class="headerlink" href="#module-matplotlib.colorbar" title="Permalink to this headline">¶</a></h2>
<p>Colorbar toolkit with two classes and a function:</p>
<blockquote>
<div><dl class="docutils">
<dt><a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">ColorbarBase</span></code></a></dt>
<dd>the base class with full colorbar drawing functionality.
It can be used as-is to make a colorbar for a given colormap;
a mappable object (e.g., image) is not needed.</dd>
<dt><a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><code class="xref py py-class docutils literal notranslate"><span class="pre">Colorbar</span></code></a></dt>
<dd>the derived class for use with images or contour plots.</dd>
<dt><a class="reference internal" href="#matplotlib.colorbar.make_axes" title="matplotlib.colorbar.make_axes"><code class="xref py py-func docutils literal notranslate"><span class="pre">make_axes()</span></code></a></dt>
<dd>a function for resizing an axes and adding a second axes
suitable for a colorbar</dd>
</dl>
</div></blockquote>
<p>The <a class="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">colorbar()</span></code></a> method uses <a class="reference internal" href="#matplotlib.colorbar.make_axes" title="matplotlib.colorbar.make_axes"><code class="xref py py-func docutils literal notranslate"><span class="pre">make_axes()</span></code></a>
and <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><code class="xref py py-class docutils literal notranslate"><span class="pre">Colorbar</span></code></a>; the <a class="reference internal" href="_as_gen/matplotlib.pyplot.colorbar.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><code class="xref py py-func docutils literal notranslate"><span class="pre">colorbar()</span></code></a> function
is a thin wrapper over <a class="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">colorbar()</span></code></a>.</p>
<dl class="class">
<dt id="matplotlib.colorbar.Colorbar">
<em class="property">class </em><code class="descclassname">matplotlib.colorbar.</code><code class="descname">Colorbar</code><span class="sig-paren">(</span><em>ax</em>, <em>mappable</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">matplotlib.colorbar.ColorbarBase</span></code></a></p>
<p>This class connects a <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase" title="matplotlib.colorbar.ColorbarBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">ColorbarBase</span></code></a> to a
<a class="reference internal" href="cm_api.html#matplotlib.cm.ScalarMappable" title="matplotlib.cm.ScalarMappable"><code class="xref py py-class docutils literal notranslate"><span class="pre">ScalarMappable</span></code></a> such as a
<a class="reference internal" href="image_api.html#matplotlib.image.AxesImage" title="matplotlib.image.AxesImage"><code class="xref py py-class docutils literal notranslate"><span class="pre">AxesImage</span></code></a> generated via
<a class="reference internal" href="_as_gen/matplotlib.axes.Axes.imshow.html#matplotlib.axes.Axes.imshow" title="matplotlib.axes.Axes.imshow"><code class="xref py py-meth docutils literal notranslate"><span class="pre">imshow()</span></code></a>.</p>
<p>It is not intended to be instantiated directly; instead,
use <a class="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">colorbar()</span></code></a> or
<a class="reference internal" href="_as_gen/matplotlib.pyplot.colorbar.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><code class="xref py py-func docutils literal notranslate"><span class="pre">colorbar()</span></code></a> to make your colorbar.</p>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.add_lines">
<code class="descname">add_lines</code><span class="sig-paren">(</span><em>CS</em>, <em>erase=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar.add_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar.add_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the lines from a non-filled
<a class="reference internal" href="contour_api.html#matplotlib.contour.ContourSet" title="matplotlib.contour.ContourSet"><code class="xref py py-class docutils literal notranslate"><span class="pre">ContourSet</span></code></a> to the colorbar.</p>
<p>Set <em>erase</em> to False if these lines should be added to
any pre-existing lines.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.on_mappable_changed">
<code class="descname">on_mappable_changed</code><span class="sig-paren">(</span><em>mappable</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar.on_mappable_changed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar.on_mappable_changed" title="Permalink to this definition">¶</a></dt>
<dd><p>Updates this colorbar to match the mappable's properties.</p>
<p>Typically this is automatically registered as an event handler
by <a class="reference internal" href="#matplotlib.colorbar.colorbar_factory" title="matplotlib.colorbar.colorbar_factory"><code class="xref py py-func docutils literal notranslate"><span class="pre">colorbar_factory()</span></code></a> and should not be called manually.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.remove">
<code class="descname">remove</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove this colorbar from the figure. If the colorbar was created with
<code class="docutils literal notranslate"><span class="pre">use_gridspec=True</span></code> then restore the gridspec to its previous value.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.update_bruteforce">
<code class="descname">update_bruteforce</code><span class="sig-paren">(</span><em>mappable</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar.update_bruteforce"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar.update_bruteforce" title="Permalink to this definition">¶</a></dt>
<dd><p>Destroy and rebuild the colorbar. This is
intended to become obsolete, and will probably be
deprecated and then removed. It is not called when
the pyplot.colorbar function or the Figure.colorbar
method are used to create the colorbar.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.Colorbar.update_normal">
<code class="descname">update_normal</code><span class="sig-paren">(</span><em>mappable</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#Colorbar.update_normal"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.Colorbar.update_normal" title="Permalink to this definition">¶</a></dt>
<dd><p>update solid, lines, etc. Unlike update_bruteforce, it does
not clear the axes. This is meant to be called when the image
or contour plot to which this colorbar belongs is changed.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.colorbar.ColorbarBase">
<em class="property">class </em><code class="descclassname">matplotlib.colorbar.</code><code class="descname">ColorbarBase</code><span class="sig-paren">(</span><em>ax</em>, <em>cmap=None</em>, <em>norm=None</em>, <em>alpha=None</em>, <em>values=None</em>, <em>boundaries=None</em>, <em>orientation='vertical'</em>, <em>ticklocation='auto'</em>, <em>extend='neither'</em>, <em>spacing='uniform'</em>, <em>ticks=None</em>, <em>format=None</em>, <em>drawedges=False</em>, <em>filled=True</em>, <em>extendfrac=None</em>, <em>extendrect=False</em>, <em>label=''</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="cm_api.html#matplotlib.cm.ScalarMappable" title="matplotlib.cm.ScalarMappable"><code class="xref py py-class docutils literal notranslate"><span class="pre">matplotlib.cm.ScalarMappable</span></code></a></p>
<p>Draw a colorbar in an existing axes.</p>
<p>This is a base class for the <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><code class="xref py py-class docutils literal notranslate"><span class="pre">Colorbar</span></code></a> class, which is the
basis for the <a class="reference internal" href="_as_gen/matplotlib.pyplot.colorbar.html#matplotlib.pyplot.colorbar" title="matplotlib.pyplot.colorbar"><code class="xref py py-func docutils literal notranslate"><span class="pre">colorbar()</span></code></a> function and the
<a class="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">colorbar()</span></code></a> method, which are the
usual ways of creating a colorbar.</p>
<p>It is also useful by itself for showing a colormap. If the <em>cmap</em>
kwarg is given but <em>boundaries</em> and <em>values</em> are left as None,
then the colormap will be displayed on a 0-1 scale. To show the
under- and over-value colors, specify the <em>norm</em> as:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">colors</span><span class="o">.</span><span class="n">Normalize</span><span class="p">(</span><span class="n">clip</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
</pre></div>
</div>
<p>To show the colors versus index instead of on the 0-1 scale,
use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">norm</span><span class="o">=</span><span class="n">colors</span><span class="o">.</span><span class="n">NoNorm</span><span class="o">.</span>
</pre></div>
</div>
<p>Useful public methods are <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase.set_label" title="matplotlib.colorbar.ColorbarBase.set_label"><code class="xref py py-meth docutils literal notranslate"><span class="pre">set_label()</span></code></a> and <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase.add_lines" title="matplotlib.colorbar.ColorbarBase.add_lines"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_lines()</span></code></a>.</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">Attributes:</th><td class="field-body"><dl class="first last docutils">
<dt><strong>ax</strong> <span class="classifier-delimiter">:</span> <span class="classifier">Axes</span></dt>
<dd><p class="first last">The <code class="xref py py-obj docutils literal notranslate"><span class="pre">Axes</span></code> instance in which the colorbar is drawn.</p>
</dd>
<dt><strong>lines</strong> <span class="classifier-delimiter">:</span> <span class="classifier">list</span></dt>
<dd><p class="first last">A list of <code class="xref py py-obj docutils literal notranslate"><span class="pre">LineCollection</span></code> if lines were drawn, otherwise
an empty list.</p>
</dd>
<dt><strong>dividers</strong> <span class="classifier-delimiter">:</span> <span class="classifier">LineCollection</span></dt>
<dd><p class="first last">A LineCollection if <em>drawedges</em> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, otherwise <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.add_lines">
<code class="descname">add_lines</code><span class="sig-paren">(</span><em>levels</em>, <em>colors</em>, <em>linewidths</em>, <em>erase=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.add_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.add_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Draw lines on the colorbar.</p>
<p><em>colors</em> and <em>linewidths</em> must be scalars or
sequences the same length as <em>levels</em>.</p>
<p>Set <em>erase</em> to False to add lines without first
removing any previously added lines.</p>
</dd></dl>
<dl class="attribute">
<dt id="matplotlib.colorbar.ColorbarBase.ax">
<code class="descname">ax</code><em class="property"> = None</em><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.ax" title="Permalink to this definition">¶</a></dt>
<dd><p>The axes that this colorbar lives in.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.config_axis">
<code class="descname">config_axis</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.config_axis"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.config_axis" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.draw_all">
<code class="descname">draw_all</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.draw_all"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.draw_all" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate any free parameters based on the current cmap and norm,
and do all the drawing.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.get_ticks">
<code class="descname">get_ticks</code><span class="sig-paren">(</span><em>minor=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.get_ticks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.get_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the x ticks as a list of locations</p>
</dd></dl>
<dl class="attribute">
<dt id="matplotlib.colorbar.ColorbarBase.n_rasterize">
<code class="descname">n_rasterize</code><em class="property"> = 50</em><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.n_rasterize" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.remove">
<code class="descname">remove</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.remove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.remove" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove this colorbar from the figure</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_alpha">
<code class="descname">set_alpha</code><span class="sig-paren">(</span><em>alpha</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.set_alpha"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_alpha" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_label">
<code class="descname">set_label</code><span class="sig-paren">(</span><em>label</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.set_label"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_label" title="Permalink to this definition">¶</a></dt>
<dd><p>Label the long axis of the colorbar</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_ticklabels">
<code class="descname">set_ticklabels</code><span class="sig-paren">(</span><em>ticklabels</em>, <em>update_ticks=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.set_ticklabels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_ticklabels" title="Permalink to this definition">¶</a></dt>
<dd><p>set tick labels. Tick labels are updated immediately unless
update_ticks is <em>False</em>. To manually update the ticks, call
<em>update_ticks</em> method explicitly.</p>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.set_ticks">
<code class="descname">set_ticks</code><span class="sig-paren">(</span><em>ticks</em>, <em>update_ticks=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.set_ticks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.set_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Set tick locations.</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"><dl class="first last docutils">
<dt><strong>ticks</strong> <span class="classifier-delimiter">:</span> <span class="classifier">{None, sequence, <a class="reference internal" href="ticker_api.html#matplotlib.ticker.Locator" title="matplotlib.ticker.Locator"><code class="xref py py-class docutils literal notranslate"><span class="pre">Locator</span></code></a> instance}</span></dt>
<dd><p class="first last">If None, a default Locator will be used.</p>
</dd>
<dt><strong>update_ticks</strong> <span class="classifier-delimiter">:</span> <span class="classifier">{True, False}, optional</span></dt>
<dd><p class="first last">If True, tick locations are updated immediately. If False,
use <a class="reference internal" href="#matplotlib.colorbar.ColorbarBase.update_ticks" title="matplotlib.colorbar.ColorbarBase.update_ticks"><code class="xref py py-meth docutils literal notranslate"><span class="pre">update_ticks()</span></code></a> to manually update the ticks.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="matplotlib.colorbar.ColorbarBase.update_ticks">
<code class="descname">update_ticks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarBase.update_ticks"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarBase.update_ticks" title="Permalink to this definition">¶</a></dt>
<dd><p>Force the update of the ticks and ticklabels. This must be
called whenever the tick locator and/or tick formatter changes.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="matplotlib.colorbar.ColorbarPatch">
<em class="property">class </em><code class="descclassname">matplotlib.colorbar.</code><code class="descname">ColorbarPatch</code><span class="sig-paren">(</span><em>ax</em>, <em>mappable</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#ColorbarPatch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.ColorbarPatch" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#matplotlib.colorbar.Colorbar" title="matplotlib.colorbar.Colorbar"><code class="xref py py-class docutils literal notranslate"><span class="pre">matplotlib.colorbar.Colorbar</span></code></a></p>
<p>A Colorbar which is created using <a class="reference internal" href="_as_gen/matplotlib.patches.Patch.html#matplotlib.patches.Patch" title="matplotlib.patches.Patch"><code class="xref py py-class docutils literal notranslate"><span class="pre">Patch</span></code></a>
rather than the default <code class="xref py py-func docutils literal notranslate"><span class="pre">pcolor()</span></code>.</p>
<p>It uses a list of Patch instances instead of a
<a class="reference internal" href="collections_api.html#matplotlib.collections.PatchCollection" title="matplotlib.collections.PatchCollection"><code class="xref py py-class docutils literal notranslate"><span class="pre">PatchCollection</span></code></a> because the
latter does not allow the hatch pattern to vary among the
members of the collection.</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.colorbar.colorbar_factory">
<code class="descclassname">matplotlib.colorbar.</code><code class="descname">colorbar_factory</code><span class="sig-paren">(</span><em>cax</em>, <em>mappable</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#colorbar_factory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.colorbar_factory" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a colorbar on the given axes for the given mappable.</p>
<p>Typically, for automatic colorbar placement given only a mappable use
<a class="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.colorbar" title="matplotlib.figure.Figure.colorbar"><code class="xref py py-meth docutils literal notranslate"><span class="pre">colorbar()</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.colorbar.make_axes">
<code class="descclassname">matplotlib.colorbar.</code><code class="descname">make_axes</code><span class="sig-paren">(</span><em>parents</em>, <em>location=None</em>, <em>orientation=None</em>, <em>fraction=0.15</em>, <em>shrink=1.0</em>, <em>aspect=20</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#make_axes"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.make_axes" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize and reposition parent axes, and return a child
axes suitable for a colorbar.</p>
<p>Keyword arguments may include the following (with defaults):</p>
<blockquote>
<div><dl class="docutils">
<dt>location <span class="classifier-delimiter">:</span> <span class="classifier">[None|'left'|'right'|'top'|'bottom']</span></dt>
<dd>The position, relative to <strong>parents</strong>, where the colorbar axes
should be created. If None, the value will either come from the
given <code class="docutils literal notranslate"><span class="pre">orientation</span></code>, else it will default to 'right'.</dd>
<dt>orientation <span class="classifier-delimiter">:</span> <span class="classifier">[None|'vertical'|'horizontal']</span></dt>
<dd>The orientation of the colorbar. Typically, this keyword shouldn't
be used, as it can be derived from the <code class="docutils literal notranslate"><span class="pre">location</span></code> keyword.</dd>
</dl>
</div></blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="82%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Property</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><em>orientation</em></td>
<td>vertical or horizontal</td>
</tr>
<tr class="row-odd"><td><em>fraction</em></td>
<td>0.15; fraction of original axes to use for colorbar</td>
</tr>
<tr class="row-even"><td><em>pad</em></td>
<td>0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and new image axes</td>
</tr>
<tr class="row-odd"><td><em>shrink</em></td>
<td>1.0; fraction by which to multiply the size of the colorbar</td>
</tr>
<tr class="row-even"><td><em>aspect</em></td>
<td>20; ratio of long to short dimensions</td>
</tr>
<tr class="row-odd"><td><em>anchor</em></td>
<td>(0.0, 0.5) if vertical; (0.5, 1.0) if horizontal;
the anchor point of the colorbar axes</td>
</tr>
<tr class="row-even"><td><em>panchor</em></td>
<td>(1.0, 0.5) if vertical; (0.5, 0.0) if horizontal;
the anchor point of the colorbar parent axes. If
False, the parent axes' anchor will be unchanged</td>
</tr>
</tbody>
</table>
<p>Returns (cax, kw), the child axes and the reduced kw dictionary to be
passed when creating the colorbar instance.</p>
</dd></dl>
<dl class="function">
<dt id="matplotlib.colorbar.make_axes_gridspec">
<code class="descclassname">matplotlib.colorbar.</code><code class="descname">make_axes_gridspec</code><span class="sig-paren">(</span><em>parent</em>, <em>**kw</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/matplotlib/colorbar.html#make_axes_gridspec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#matplotlib.colorbar.make_axes_gridspec" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize and reposition a parent axes, and return a child axes
suitable for a colorbar. This function is similar to
make_axes. Prmary differences are</p>
<blockquote>
<div><ul class="simple">
<li><em>make_axes_gridspec</em> only handles the <em>orientation</em> keyword
and cannot handle the "location" keyword.</li>
<li><em>make_axes_gridspec</em> should only be used with a subplot parent.</li>
<li><dl class="first docutils">
<dt><em>make_axes</em> creates an instance of Axes. <em>make_axes_gridspec</em></dt>
<dd>creates an instance of Subplot.</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><em>make_axes</em> updates the position of the</dt>
<dd>parent. <em>make_axes_gridspec</em> replaces the grid_spec attribute
of the parent with a new one.</dd>
</dl>
</li>
</ul>
</div></blockquote>
<p>While this function is meant to be compatible with <em>make_axes</em>,
there could be some minor differences.</p>
<p>Keyword arguments may include the following (with defaults):</p>
<blockquote>
<div><dl class="docutils">
<dt><em>orientation</em></dt>
<dd>'vertical' or 'horizontal'</dd>
</dl>
</div></blockquote>
<table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="82%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Property</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><em>orientation</em></td>
<td>vertical or horizontal</td>
</tr>
<tr class="row-odd"><td><em>fraction</em></td>
<td>0.15; fraction of original axes to use for colorbar</td>
</tr>
<tr class="row-even"><td><em>pad</em></td>
<td>0.05 if vertical, 0.15 if horizontal; fraction
of original axes between colorbar and new image axes</td>
</tr>
<tr class="row-odd"><td><em>shrink</em></td>
<td>1.0; fraction by which to multiply the size of the colorbar</td>
</tr>
<tr class="row-even"><td><em>aspect</em></td>
<td>20; ratio of long to short dimensions</td>
</tr>
<tr class="row-odd"><td><em>anchor</em></td>
<td>(0.0, 0.5) if vertical; (0.5, 1.0) if horizontal;
the anchor point of the colorbar axes</td>
</tr>
<tr class="row-even"><td><em>panchor</em></td>
<td>(1.0, 0.5) if vertical; (0.5, 0.0) if horizontal;
the anchor point of the colorbar parent axes. If
False, the parent axes' anchor will be unchanged</td>
</tr>
</tbody>
</table>
<p>All but the first of these are stripped from the input kw set.</p>
<p>Returns (cax, kw), the child axes and the reduced kw dictionary to be
passed when creating the colorbar instance.</p>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The Matplotlib development team.
<br />
Last updated on Feb 28, 2019.
Created using
<ahref="http://sphinx-doc.org/">Sphinx</a> 1.8.4.
Doc version v2.2.4-2-g38a93e9a0-dirty.
</div>
</body>
<footer>
</footer>
</html>