You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
<divid="unreleased-message"> You are reading an old version of the documentation (v1.5.0). For the latest version see <ahref="https://matplotlib.org/stable/api/pyplot_summary.html">https://matplotlib.org/stable/api/pyplot_summary.html</a></div>
<h1>Plotting commands summary<aclass="headerlink" href="#plotting-commands-summary" title="Permalink to this headline">¶</a></h1>
<dlclass="function">
<dtid="matplotlib.pyplot.plotting">
<codeclass="descclassname">matplotlib.pyplot.</code><codeclass="descname">plotting</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.pyplot.plotting" title="Permalink to this definition">¶</a></dt>
<td>Get the current <aclass="reference internal" href="axes_api.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-class docutils literal"><spanclass="pre">Axes</span></code></a> instance on the current figure matching the given keyword args, or create one.</td>
<td>Change the <aclass="reference internal" href="ticker_api.html#matplotlib.ticker.ScalarFormatter" title="matplotlib.ticker.ScalarFormatter"><codeclass="xref py py-obj docutils literal"><spanclass="pre">ScalarFormatter</span></code></a> used by default for linear axes.</td>
<td>Get or set the <em>y</em>-limits of the current tick locations and labels.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dlclass="function">
<dtid="matplotlib.pyplot.colormaps">
<codeclass="descclassname">matplotlib.pyplot.</code><codeclass="descname">colormaps</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink" href="#matplotlib.pyplot.colormaps" title="Permalink to this definition">¶</a></dt>
<dd><p>Matplotlib provides a number of colormaps, and others can be added using
<aclass="reference internal" href="cm_api.html#matplotlib.cm.register_cmap" title="matplotlib.cm.register_cmap"><codeclass="xref py py-func docutils literal"><spanclass="pre">register_cmap()</span></code></a>. This function documents the built-in
colormaps, and will also return a list of all registered colormaps if called.</p>
<p>You can set the colormap for an image, pcolor, scatter, etc,
<p>In interactive mode, <aclass="reference internal" href="pyplot_api.html#matplotlib.pyplot.set_cmap" title="matplotlib.pyplot.set_cmap"><codeclass="xref py py-func docutils literal"><spanclass="pre">set_cmap()</span></code></a> will update the colormap post-hoc,
allowing you to see which one works best for your data.</p>
<p>All built-in colormaps can be reversed by appending <codeclass="docutils literal"><spanclass="pre">_r</span></code>: For instance,
<codeclass="docutils literal"><spanclass="pre">gray_r</span></code> is the reverse of <codeclass="docutils literal"><spanclass="pre">gray</span></code>.</p>
<p>There are several common color schemes used in visualization:</p>
<dlclass="docutils">
<dt>Sequential schemes</dt>
<dd>for unipolar data that progresses from low to high</dd>
<dt>Diverging schemes</dt>
<dd>for bipolar data that emphasizes positive or negative deviations from a
central value</dd>
<dt>Cyclic schemes</dt>
<dd>meant for plotting values that wrap around at the
endpoints, such as phase angle, wind direction, or time of day</dd>
<dt>Qualitative schemes</dt>
<dd>for nominal data that has no inherent ordering, where color is used
only to distinguish categories</dd>
</dl>
<p>The base colormaps are derived from those of the same name provided
with Matlab:</p>
<blockquote>
<div><tableborder="1" class="docutils">
<colgroup>
<colwidth="13%" />
<colwidth="87%" />
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head">Colormap</th>
<thclass="head">Description</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>autumn</td>
<td>sequential linearly-increasing shades of red-orange-yellow</td>
</tr>
<trclass="row-odd"><td>bone</td>
<td>sequential increasing black-white color map with
a tinge of blue, to emulate X-ray film</td>
</tr>
<trclass="row-even"><td>cool</td>
<td>linearly-decreasing shades of cyan-magenta</td>
</tr>
<trclass="row-odd"><td>copper</td>
<td>sequential increasing shades of black-copper</td>
</tr>
<trclass="row-even"><td>flag</td>
<td>repetitive red-white-blue-black pattern (not cyclic at
endpoints)</td>
</tr>
<trclass="row-odd"><td>gray</td>
<td>sequential linearly-increasing black-to-white
grayscale</td>
</tr>
<trclass="row-even"><td>hot</td>
<td>sequential black-red-yellow-white, to emulate blackbody
radiation from an object at increasing temperatures</td>
</tr>
<trclass="row-odd"><td>hsv</td>
<td>cyclic red-yellow-green-cyan-blue-magenta-red, formed
by changing the hue component in the HSV color space</td>
</tr>
<trclass="row-even"><td>inferno</td>
<td>perceptually uniform shades of black-red-yellow</td>
</tr>
<trclass="row-odd"><td>jet</td>
<td>a spectral map with dark endpoints, blue-cyan-yellow-red;
based on a fluid-jet simulation by NCSA <aclass="footnote-reference" href="#id6" id="id1">[1]</a></td>
</tr>
<trclass="row-even"><td>magma</td>
<td>perceptually uniform shades of black-red-white</td>
Research <aclass="footnote-reference" href="#id7" id="id2">[2]</a></td>
</tr>
<trclass="row-odd"><td>gist_rainbow</td>
<td>runs through the colors in spectral order from red to
violet at full saturation (like <em>hsv</em> but not cyclic)</td>
</tr>
<trclass="row-even"><td>gist_stern</td>
<td>“Stern special” color table from Interactive Data
Language software</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The following colormaps are based on the <aclass="reference external" href="http://colorbrewer.org">ColorBrewer</a> color specifications and designs developed by
Cynthia Brewer:</p>
<p>ColorBrewer Diverging (luminance is highest at the midpoint, and
decreases towards differently-colored endpoints):</p>
<tr><tdclass="label"><aclass="fn-backref" href="#id1">[1]</a></td><td>Rainbow colormaps, <codeclass="docutils literal"><spanclass="pre">jet</span></code> in particular, are considered a poor
choice for scientific visualization by many researchers: <aclass="reference external" href="http://www.jwave.vt.edu/%7Erkriz/Projects/create_color_table/color_07.pdf">Rainbow Color
<tr><tdclass="label"><aclass="fn-backref" href="#id3">[3]</a></td><td>See <aclass="reference external" href="http://www.cs.unm.edu/~kmorel/documents/ColorMaps/">Diverging Color Maps for Scientific Visualization</a> by Kenneth
<tr><tdclass="label"><aclass="fn-backref" href="#id4">[4]</a></td><td>See <aclass="reference external" href="http://www.mathworks.com/matlabcentral/fileexchange/2662-cmrmap-m">A Color Map for Effective Black-and-White Rendering of