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 (v3.2.2). 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><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.pyplot</span></code><aclass="headerlink" href="#matplotlib-pyplot" title="Permalink to this headline">¶</a></h1>
<td><aclass="reference internal" href="_as_gen/matplotlib.pyplot.html#module-matplotlib.pyplot" title="matplotlib.pyplot"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.pyplot</span></code></a> is a state-based interface to matplotlib.</td>
</tr>
</tbody>
</table>
<dlclass="py function">
<dtid="matplotlib.pyplot.plotting">
<codeclass="descclassname">matplotlib.pyplot.</code><codeclass="descname">plotting</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/pyplot.html#plotting"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink" href="#matplotlib.pyplot.plotting" title="Permalink to this definition">¶</a></dt>
<td>Remove the <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes</span></code><em>ax</em> (defaulting to the current axes) from its figure.</td>
<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 notranslate"><spanclass="pre">Axes</span></code></a> instance on the current figure matching the given keyword args, or create one.</td>
<td>Add a table to an <aclass="reference internal" href="axes_api.html#matplotlib.axes.Axes" title="matplotlib.axes.Axes"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes</span></code></a>.</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 notranslate"><spanclass="pre">ScalarFormatter</span></code></a> used by default for linear axes.</td>
<td>Get or set the current tick locations and labels of the y-axis.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<divclass="section" id="colors-in-matplotlib">
<h2>Colors in Matplotlib<aclass="headerlink" href="#colors-in-matplotlib" title="Permalink to this headline">¶</a></h2>
<p>There are many colormaps you can use to map data onto color values.
Below we list several ways in which color can be utilized in Matplotlib.</p>
<p>For a more in-depth look at colormaps, see the
<aclass="reference internal" href="../tutorials/colors/colormaps.html"><spanclass="doc">Choosing Colormaps in Matplotlib</span></a> tutorial.</p>
<dlclass="py function">
<dtid="matplotlib.pyplot.colormaps">
<codeclass="descclassname">matplotlib.pyplot.</code><codeclass="descname">colormaps</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal" href="../_modules/matplotlib/pyplot.html#colormaps"><spanclass="viewcode-link">[source]</span></a><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 notranslate"><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="_as_gen/matplotlib.pyplot.set_cmap.html#matplotlib.pyplot.set_cmap" title="matplotlib.pyplot.set_cmap"><codeclass="xref py py-func docutils literal notranslate"><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 notranslate"><spanclass="pre">_r</span></code>: For instance,
<codeclass="docutils literal notranslate"><spanclass="pre">gray_r</span></code> is the reverse of <codeclass="docutils literal notranslate"><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>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>Matplotlib ships with 4 perceptually uniform color maps which are
the recommended color maps for sequential data:</p>
<td>perceptually uniform shades of black-red-yellow</td>
</tr>
<trclass="row-odd"><td>magma</td>
<td>perceptually uniform shades of black-red-white</td>
</tr>
<trclass="row-even"><td>plasma</td>
<td>perceptually uniform shades of blue-red-yellow</td>
</tr>
<trclass="row-odd"><td>viridis</td>
<td>perceptually uniform shades of blue-green-yellow</td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>The following colormaps are based on the <aclass="reference external" href="http://colorbrewer2.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 notranslate"><spanclass="pre">jet</span></code> in particular, are considered a poor
choice for scientific visualization by many researchers: <aclass="reference external" href="http://ieeexplore.ieee.org/document/4118486/?arnumber=4118486">Rainbow Color