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.0.3). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<li><aclass="reference internal" href="#matplotlib-use-now-has-an-importerror-for-interactive-backend">Matplotlib.use now has an ImportError for interactive backend</a></li>
</ul>
</li>
<li><aclass="reference internal" href="#api-changes-for-3-0-1">API Changes for 3.0.1</a></li>
<li><aclass="reference internal" href="#api-changes-for-3-0-0">API Changes for 3.0.0</a><ul>
<li><aclass="reference internal" href="#drop-support-for-python-2">Drop support for python 2</a></li>
<li><aclass="reference internal" href="#changes-to-backend-loading">Changes to backend loading</a></li>
<li><aclass="reference internal" href="#axes-hist2d-now-uses-pcolormesh-instead-of-pcolorfast"><codeclass="docutils literal notranslate"><spanclass="pre">Axes.hist2d</span></code> now uses <codeclass="docutils literal notranslate"><spanclass="pre">pcolormesh</span></code> instead of <codeclass="docutils literal notranslate"><spanclass="pre">pcolorfast</span></code></a></li>
<li><aclass="reference internal" href="#matplotlib-axes-axes-get-tightbbox-now-includes-all-artists"><codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.axes.Axes.get_tightbbox</span></code> now includes all artists</a></li>
<li><aclass="reference internal" href="#text-set-text-with-string-argument-none-sets-string-to-empty"><codeclass="docutils literal notranslate"><spanclass="pre">Text.set_text</span></code> with string argument <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> sets string to empty</a></li>
<li><aclass="reference internal" href="#axes3d-get-xlim-get-ylim-and-get-zlim-now-return-a-tuple"><codeclass="docutils literal notranslate"><spanclass="pre">Axes3D.get_xlim</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">get_ylim</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">get_zlim</span></code> now return a tuple</a></li>
<li><aclass="reference internal" href="#font-manager-list-fonts-now-follows-the-platform-s-casefolding-semantics"><codeclass="docutils literal notranslate"><spanclass="pre">font_manager.list_fonts</span></code> now follows the platform's casefolding semantics</a></li>
<li><aclass="reference internal" href="#bar-barh-no-longer-accepts-left-bottom-as-first-named-argument"><codeclass="docutils literal notranslate"><spanclass="pre">bar</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">barh</span></code> no longer accepts <codeclass="docutils literal notranslate"><spanclass="pre">left</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">bottom</span></code> as first named argument</a></li>
<li><aclass="reference internal" href="#different-exception-types-for-undocumented-options">Different exception types for undocumented options</a></li>
<li><aclass="reference internal" href="#improved-call-signature-for-axes-margins">Improved call signature for <codeclass="docutils literal notranslate"><spanclass="pre">Axes.margins</span></code></a></li>
<li><aclass="reference internal" href="#explicit-arguments-instead-of-args-kwargs">Explicit arguments instead of *args, **kwargs</a></li>
<li><aclass="reference internal" href="#cleanup-decorators-and-test-classes-no-longer-destroy-warnings-filter-on-exit">Cleanup decorators and test classes no longer destroy warnings filter on exit</a></li>
<li><aclass="reference internal" href="#non-interactive-figuremanager-classes-are-now-aliases-of-figuremanagerbase">Non-interactive FigureManager classes are now aliases of FigureManagerBase</a></li>
<li><aclass="reference internal" href="#change-to-the-output-of-image-thumbnail">Change to the output of <codeclass="docutils literal notranslate"><spanclass="pre">image.thumbnail</span></code></a></li>
<li><aclass="reference internal" href="#funcanimation-now-draws-artists-according-to-their-zorder-when-blitting"><codeclass="docutils literal notranslate"><spanclass="pre">FuncAnimation</span></code> now draws artists according to their zorder when blitting</a></li>
<li><aclass="reference internal" href="#contour-color-autoscaling-improvements">Contour color autoscaling improvements</a></li>
<li><aclass="reference internal" href="#streamplot-last-row-and-column-fixed">Streamplot last row and column fixed</a></li>
<li><aclass="reference internal" href="#axes-get-position-now-returns-actual-position-if-aspect-changed"><codeclass="docutils literal notranslate"><spanclass="pre">Axes.get_position</span></code> now returns actual position if aspect changed</a></li>
<li><aclass="reference internal" href="#the-ticks-for-colorbar-now-adjust-for-the-size-of-the-colorbar">The ticks for colorbar now adjust for the size of the colorbar</a></li>
<li><aclass="reference internal" href="#colorbar-for-log-scaled-hexbin">Colorbar for log-scaled hexbin</a></li>
<li><aclass="reference internal" href="#pgf-backend-now-explicitly-makes-black-text-black">PGF backend now explicitly makes black text black</a></li>
<li><aclass="reference internal" href="#blacklisted-rcparams-no-longer-updated-by-rcdefaults-rc-file-defaults-rc-file">Blacklisted rcparams no longer updated by <codeclass="docutils literal notranslate"><spanclass="pre">rcdefaults</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">rc_file_defaults</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">rc_file</span></code></a></li>
<li><aclass="reference internal" href="#callbackregistry-now-stores-callbacks-using-stdlib-s-weakmethods"><codeclass="docutils literal notranslate"><spanclass="pre">CallbackRegistry</span></code> now stores callbacks using stdlib's <codeclass="docutils literal notranslate"><spanclass="pre">WeakMethod</span></code>s</a></li>
<li><aclass="reference internal" href="#changes-regarding-the-text-latex-unicode-rcparam">Changes regarding the text.latex.unicode rcParam</a></li>
<li><aclass="reference internal" href="#return-type-of-artistinspector-get-aliases-changed">Return type of ArtistInspector.get_aliases changed</a></li>
<li><aclass="reference internal" href="#removed-pytz-as-a-dependency">Removed <codeclass="docutils literal notranslate"><spanclass="pre">pytz</span></code> as a dependency</a></li>
<li><aclass="reference internal" href="#deprecation-of-locatableaxes-in-toolkits">Deprecation of <codeclass="docutils literal notranslate"><spanclass="pre">LocatableAxes</span></code> in toolkits</a></li>
<h1>API Changes<aclass="headerlink" href="#api-changes" title="Permalink to this headline">¶</a></h1>
<p>A log of changes to the most recent version of Matplotlib that affect the
outward-facing API. If updating Matplotlib breaks your scripts, this list may
help you figure out what caused the breakage and how to fix it by updating
your code. For API changes in older versions see <aclass="reference internal" href="api_changes_old.html"><spanclass="doc">Old API Changes</span></a>.</p>
<p>For new features that were added to Matplotlib, see <aclass="reference internal" href="../users/whats_new.html#whats-new"><spanclass="std std-ref">What's new in Matplotlib 3.0.3</span></a>.</p>
<p>This pages lists API changes for the most recent version of Matplotlib.</p>
<divclass="toctree-wrapper compound">
<ul>
<liclass="toctree-l1"><aclass="reference internal" href="api_changes_old.html">Old API Changes</a></li>
</ul>
</div>
<blockquote>
<div><divclass="admonition note">
<pclass="first admonition-title">Note</p>
<p>The list below is a table of contents of individual files from the 'next_api_changes' folder.
When a release is made</p>
<blockquoteclass="last">
<div><blockquote>
<div><ulclass="simple">
<li>The full text list below should be moved into its own file in
'prev_api_changes' for minor and major versions, add sections at
the top for bug-fix releases.</li>
<li>All the files in 'next_api_changes' should be moved to the bottom of this page</li>
<li>This note, and the toctree below should be commented out</li>
</ul>
</div></blockquote>
<divclass="toctree-wrapper compound">
<ul>
<liclass="toctree-l1"><aclass="reference internal" href="next_api_changes/README.html">Adding API change notes</a></li>
</ul>
</div>
</div></blockquote>
</div>
</div></blockquote>
<divclass="section" id="api-changes-for-3-0-3">
<h2>API Changes for 3.0.3<aclass="headerlink" href="#api-changes-for-3-0-3" title="Permalink to this headline">¶</a></h2>
<h3>matplotlib.font_manager.win32InstalledFonts return value<aclass="headerlink" href="#matplotlib-font-manager-win32installedfonts-return-value" title="Permalink to this headline">¶</a></h3>
<p><aclass="reference internal" href="font_manager_api.html#matplotlib.font_manager.win32InstalledFonts" title="matplotlib.font_manager.win32InstalledFonts"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.font_manager.win32InstalledFonts</span></code></a> returns an empty list instead
<h3>Matplotlib.use now has an ImportError for interactive backend<aclass="headerlink" href="#matplotlib-use-now-has-an-importerror-for-interactive-backend" title="Permalink to this headline">¶</a></h3>
<p>Switching backends via <aclass="reference internal" href="matplotlib_configuration_api.html#matplotlib.use" title="matplotlib.use"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.use</span></code></a> is now allowed by default,
regardless of whether <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> has been imported. If the user
tries to switch from an already-started interactive backend to a different
interactive backend, an ImportError will be raised.</p>
</div>
</div>
<divclass="section" id="api-changes-for-3-0-1">
<h2>API Changes for 3.0.1<aclass="headerlink" href="#api-changes-for-3-0-1" title="Permalink to this headline">¶</a></h2>
<p><aclass="reference internal" href="tight_layout_api.html#matplotlib.tight_layout.auto_adjust_subplotpars" title="matplotlib.tight_layout.auto_adjust_subplotpars"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">tight_layout.auto_adjust_subplotpars</span></code></a> can return <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> now if the new
subplotparams will collapse axes to zero width or height. This prevents
<codeclass="docutils literal notranslate"><spanclass="pre">tight_layout</span></code> from being executed. Similarly
which will improve the handling of log-axes. Note that the
returned <em>image</em> now is of type <aclass="reference internal" href="collections_api.html#matplotlib.collections.QuadMesh" title="matplotlib.collections.QuadMesh"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">QuadMesh</span></code></a>
<h3><aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_tightbbox.html#matplotlib.axes.Axes.get_tightbbox" title="matplotlib.axes.Axes.get_tightbbox"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.axes.Axes.get_tightbbox</span></code></a> now includes all artists<aclass="headerlink" href="#matplotlib-axes-axes-get-tightbbox-now-includes-all-artists" title="Permalink to this headline">¶</a></h3>
<p>For Matplotlib 3.0, <em>all</em> artists are now included in the bounding box
returned by <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_tightbbox.html#matplotlib.axes.Axes.get_tightbbox" title="matplotlib.axes.Axes.get_tightbbox"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.axes.Axes.get_tightbbox</span></code></a>.</p>
<p><aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_tightbbox.html#matplotlib.axes.Axes.get_tightbbox" title="matplotlib.axes.Axes.get_tightbbox"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.axes.Axes.get_tightbbox</span></code></a> adds a new kwarg <codeclass="docutils literal notranslate"><spanclass="pre">bbox_extra_artists</span></code>
to manually specify the list of artists on the axes to include in the
and <codeclass="docutils literal notranslate"><spanclass="pre">fig.savefig('fname.png',</span><spanclass="pre">bbox_inches="tight")</span></code> use
<aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_tightbbox.html#matplotlib.axes.Axes.get_tightbbox" title="matplotlib.axes.Axes.get_tightbbox"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.axes.Axes.get_tightbbox</span></code></a> to determine the bounds of each axes on
a figure and adjust spacing between axes.</p>
<p>In Matplotlib 2.2 <codeclass="docutils literal notranslate"><spanclass="pre">get_tightbbox</span></code> started to include legends made on the
axes, but still excluded some other artists, like text that may overspill an
axes. This has been expanded to include <em>all</em> artists.</p>
<p>This new default may be overridden in either of three ways:</p>
<olclass="arabic simple">
<li>Make the artist to be excluded a child of the figure, not the axes. E.g.,
call <codeclass="docutils literal notranslate"><spanclass="pre">fig.legend()</span></code> instead of <codeclass="docutils literal notranslate"><spanclass="pre">ax.legend()</span></code> (perhaps using
<aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_legend_handles_labels.html#matplotlib.axes.Axes.get_legend_handles_labels" title="matplotlib.axes.Axes.get_legend_handles_labels"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">get_legend_handles_labels</span></code></a> to gather handles and
labels from the parent axes).</li>
<li>If the artist is a child of the axes, set the artist property
<li>Manually specify a list of artists in the new kwarg <codeclass="docutils literal notranslate"><spanclass="pre">bbox_extra_artists</span></code>.</li>
<h3><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text.set_text</span></code> with string argument <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> sets string to empty<aclass="headerlink" href="#text-set-text-with-string-argument-none-sets-string-to-empty" title="Permalink to this headline">¶</a></h3>
<p><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text.set_text</span></code> when passed a string value of <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> would set the
string to <codeclass="docutils literal notranslate"><spanclass="pre">"None"</span></code>, so subsequent calls to <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text.get_text</span></code> would return
the ambiguous <codeclass="docutils literal notranslate"><spanclass="pre">"None"</span></code> string.</p>
<p>This change sets text objects passed <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> to have empty strings, so that
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Text.get_text</span></code> returns an empty string.</p>
<h3><codeclass="docutils literal notranslate"><spanclass="pre">Axes3D.get_xlim</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">get_ylim</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">get_zlim</span></code> now return a tuple<aclass="headerlink" href="#axes3d-get-xlim-get-ylim-and-get-zlim-now-return-a-tuple" title="Permalink to this headline">¶</a></h3>
<p>They previously returned an array. Returning a tuple is consistent with the
<h3><codeclass="docutils literal notranslate"><spanclass="pre">font_manager.list_fonts</span></code> now follows the platform's casefolding semantics<aclass="headerlink" href="#font-manager-list-fonts-now-follows-the-platform-s-casefolding-semantics" title="Permalink to this headline">¶</a></h3>
<p>i.e., it behaves case-insensitively on Windows only.</p>
<h3><codeclass="docutils literal notranslate"><spanclass="pre">bar</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">barh</span></code> no longer accepts <codeclass="docutils literal notranslate"><spanclass="pre">left</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">bottom</span></code> as first named argument<aclass="headerlink" href="#bar-barh-no-longer-accepts-left-bottom-as-first-named-argument" title="Permalink to this headline">¶</a></h3>
<p>These arguments were renamed in 2.0 to <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">y</span></code> following the change of the
default alignment from <codeclass="docutils literal notranslate"><spanclass="pre">edge</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">center</span></code>.</p>
<h3>Different exception types for undocumented options<aclass="headerlink" href="#different-exception-types-for-undocumented-options" title="Permalink to this headline">¶</a></h3>
was never supported. It now raises <codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code> like all other
unsupported styles, rather than <codeclass="docutils literal notranslate"><spanclass="pre">NotImplementedError</span></code>.</li>
<li>Passing the undocumented <codeclass="docutils literal notranslate"><spanclass="pre">xmin</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">xmax</span></code> arguments to
<aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.set_xlim.html#matplotlib.axes.Axes.set_xlim" title="matplotlib.axes.Axes.set_xlim"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">set_xlim()</span></code></a> would silently override the <codeclass="docutils literal notranslate"><spanclass="pre">left</span></code>
and <codeclass="docutils literal notranslate"><spanclass="pre">right</span></code> arguments. <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.set_ylim.html#matplotlib.axes.Axes.set_ylim" title="matplotlib.axes.Axes.set_ylim"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">set_ylim()</span></code></a> and the
3D equivalents (e.g. <codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">set_zlim3d()</span></code>) had a
corresponding problem.
The <codeclass="docutils literal notranslate"><spanclass="pre">_min</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">_max</span></code> arguments are now deprecated, and a <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code>
will be raised if they would override the earlier limit arguments.</li>
<h3>Improved call signature for <codeclass="docutils literal notranslate"><spanclass="pre">Axes.margins</span></code><aclass="headerlink" href="#improved-call-signature-for-axes-margins" title="Permalink to this headline">¶</a></h3>
no longer accept arbitrary keywords. <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code> will therefore be raised
if unknown kwargs are passed; previously they would be silently ignored.</p>
<p>If too many positional arguments are passed, <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code> will be raised
instead of <codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code>, for consistency with other call-signature violations.</p>
<p><codeclass="docutils literal notranslate"><spanclass="pre">Axes3D.margins</span></code> now raises <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code> instead of emitting a deprecation
warning if only two positional arguments are passed. To supply only <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">y</span></code> margins, use keyword arguments.</p>
<h3>Explicit arguments instead of *args, **kwargs<aclass="headerlink" href="#explicit-arguments-instead-of-args-kwargs" title="Permalink to this headline">¶</a></h3>
to provide explicit call signatures - where we previously used
<codeclass="docutils literal notranslate"><spanclass="pre">*args,</span><spanclass="pre">**kwargs</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">kwargs.pop</span></code>, we can now expose named
arguments. In some places, unknown kwargs were previously ignored but
now raise <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code> because <codeclass="docutils literal notranslate"><spanclass="pre">**kwargs</span></code> has been removed.</p>
<h3>Cleanup decorators and test classes no longer destroy warnings filter on exit<aclass="headerlink" href="#cleanup-decorators-and-test-classes-no-longer-destroy-warnings-filter-on-exit" title="Permalink to this headline">¶</a></h3>
<p>The decorators and classes in matplotlib.testing.decorators no longer
destroy the warnings filter on exit. Instead, they restore the warnings
filter that existed before the test started using <codeclass="docutils literal notranslate"><spanclass="pre">warnings.catch_warnings</span></code>.</p>
<h3>Non-interactive FigureManager classes are now aliases of FigureManagerBase<aclass="headerlink" href="#non-interactive-figuremanager-classes-are-now-aliases-of-figuremanagerbase" title="Permalink to this headline">¶</a></h3>
which were previously empty subclasses of <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FigureManagerBase</span></code> (i.e., not
adding or overriding any attribute or method), are now direct aliases for
<h3>Change to the output of <aclass="reference internal" href="image_api.html#matplotlib.image.thumbnail" title="matplotlib.image.thumbnail"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">image.thumbnail</span></code></a><aclass="headerlink" href="#change-to-the-output-of-image-thumbnail" title="Permalink to this headline">¶</a></h3>
<p>When called with <codeclass="docutils literal notranslate"><spanclass="pre">preview=False</span></code>, <aclass="reference internal" href="image_api.html#matplotlib.image.thumbnail" title="matplotlib.image.thumbnail"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">image.thumbnail</span></code></a> previously returned an
figure whose canvas class was set according to the output file extension. It
now returns a figure whose canvas class is the base <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FigureCanvasBase</span></code> (and
relies on <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FigureCanvasBase.print_figure</span></code>) to handle the canvas switching
properly).</p>
<p>As a side effect of this change, <aclass="reference internal" href="image_api.html#matplotlib.image.thumbnail" title="matplotlib.image.thumbnail"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">image.thumbnail</span></code></a> now also supports .ps, .eps,
<h3><aclass="reference internal" href="_as_gen/matplotlib.animation.FuncAnimation.html#matplotlib.animation.FuncAnimation" title="matplotlib.animation.FuncAnimation"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FuncAnimation</span></code></a> now draws artists according to their zorder when blitting<aclass="headerlink" href="#funcanimation-now-draws-artists-according-to-their-zorder-when-blitting" title="Permalink to this headline">¶</a></h3>
<p><aclass="reference internal" href="_as_gen/matplotlib.animation.FuncAnimation.html#matplotlib.animation.FuncAnimation" title="matplotlib.animation.FuncAnimation"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">FuncAnimation</span></code></a> now draws artists returned by the user-
function according to their zorder when using blitting,
instead of using the order in which they are being passed.
However, note that only zorder of passed artists will be
respected, as they are drawn on top of any existing artists
(see <aclass="reference external" href="https://github.com/matplotlib/matplotlib/issues/11369">#11369</a>).</p>
<h3>Contour color autoscaling improvements<aclass="headerlink" href="#contour-color-autoscaling-improvements" title="Permalink to this headline">¶</a></h3>
<p>Selection of contour levels is now the same for contour and
contourf; previously, for contour, levels outside the data range were
deleted. (Exception: if no contour levels are found within the
data range, the <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">levels</span></code> attribute is replaced with a list holding
only the minimum of the data range.)</p>
<p>When contour is called with levels specified as a target number rather
than a list, and the 'extend' kwarg is used, the levels are now chosen
such that some data typically will fall in the extended range.</p>
<p>When contour is called with a <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">LogNorm</span></code> or a <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">LogLocator</span></code>, it will now
select colors using the geometric mean rather than the arithmetic mean
<h3>Streamplot last row and column fixed<aclass="headerlink" href="#streamplot-last-row-and-column-fixed" title="Permalink to this headline">¶</a></h3>
<p>A bug was fixed where the last row and column of data in
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">streamplot</span></code> were being dropped.</p>
<h3>Changed default <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">AutoDateLocator</span></code> kwarg <em>interval_multiples</em> to <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code><aclass="headerlink" href="#changed-default-autodatelocator-kwarg-interval-multiples-to-true" title="Permalink to this headline">¶</a></h3>
<p>The default value of the tick locator for dates, <aclass="reference internal" href="dates_api.html#matplotlib.dates.AutoDateLocator" title="matplotlib.dates.AutoDateLocator"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">dates.AutoDateLocator</span></code></a>
kwarg <em>interval_multiples</em> was set to <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code> which leads to not-nice
looking automatic ticks in many instances. The much nicer
<codeclass="docutils literal notranslate"><spanclass="pre">interval_multiples=True</span></code> is the new default. See below to get the
<h3><aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_position.html#matplotlib.axes.Axes.get_position" title="matplotlib.axes.Axes.get_position"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes.get_position</span></code></a> now returns actual position if aspect changed<aclass="headerlink" href="#axes-get-position-now-returns-actual-position-if-aspect-changed" title="Permalink to this headline">¶</a></h3>
<p><aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.get_position.html#matplotlib.axes.Axes.get_position" title="matplotlib.axes.Axes.get_position"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes.get_position</span></code></a> used to return the original position unless a
draw had been triggered or <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.apply_aspect.html#matplotlib.axes.Axes.apply_aspect" title="matplotlib.axes.Axes.apply_aspect"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes.apply_aspect</span></code></a> had been called, even
if the kwarg <em>original</em> was set to <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>. Now <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.apply_aspect.html#matplotlib.axes.Axes.apply_aspect" title="matplotlib.axes.Axes.apply_aspect"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes.apply_aspect</span></code></a>
is called so <codeclass="docutils literal notranslate"><spanclass="pre">ax.get_position()</span></code> will return the new modified position.
To get the old behavior use <codeclass="docutils literal notranslate"><spanclass="pre">ax.get_position(original=True)</span></code>.</p>
<h3>The ticks for colorbar now adjust for the size of the colorbar<aclass="headerlink" href="#the-ticks-for-colorbar-now-adjust-for-the-size-of-the-colorbar" title="Permalink to this headline">¶</a></h3>
<p>Colorbar ticks now adjust for the size of the colorbar if the
colorbar is made from a mappable that is not a contour or
doesn't have a BoundaryNorm, or boundaries are not specified.
If boundaries, etc are specified, the colorbar maintains the
<h3>Colorbar for log-scaled hexbin<aclass="headerlink" href="#colorbar-for-log-scaled-hexbin" title="Permalink to this headline">¶</a></h3>
<p>When using <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">hexbin</span></code> and plotting with a logarithmic color scale, the colorbar
ticks are now correctly log scaled. Previously the tick values were linear
<h3>PGF backend now explicitly makes black text black<aclass="headerlink" href="#pgf-backend-now-explicitly-makes-black-text-black" title="Permalink to this headline">¶</a></h3>
<p>Previous behavior with the pgf backend was for text specified as black to
actually be the default color of whatever was rendering the pgf file (which was
of course usually black). The new behavior is that black text is black,
regardless of the default color. However, this means that there is no way to
fall back on the default color of the renderer.</p>
now ignore rcParams in the <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">matplotlib.style.core.STYLE_BLACKLIST</span></code> set. In
particular, this prevents the <codeclass="docutils literal notranslate"><spanclass="pre">backend</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">interactive</span></code> rcParams from
being incorrectly modified by these functions.</p>
<h3><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">CallbackRegistry</span></code> now stores callbacks using stdlib's <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">WeakMethod</span></code>s<aclass="headerlink" href="#callbackregistry-now-stores-callbacks-using-stdlib-s-weakmethods" title="Permalink to this headline">¶</a></h3>
<p>In particular, this implies that <codeclass="docutils literal notranslate"><spanclass="pre">CallbackRegistry.callbacks[signal]</span></code> is now
a mapping of callback ids to <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">WeakMethod</span></code>s (i.e., they need to be first called
with no arguments to retrieve the method itself).</p>
<h3>Changes regarding the text.latex.unicode rcParam<aclass="headerlink" href="#changes-regarding-the-text-latex-unicode-rcparam" title="Permalink to this headline">¶</a></h3>
<p>The rcParam now defaults to True and is deprecated (i.e., in future versions
of Maplotlib, unicode input will always be supported).</p>
<p>Moreover, the underlying implementation now uses <codeclass="docutils literal notranslate"><spanclass="pre">\usepackage[utf8]{inputenc}</span></code>
instead of <codeclass="docutils literal notranslate"><spanclass="pre">\usepackage{ucs}\usepackage[utf8x]{inputenc}</span></code>.</p>
<h3>Return type of ArtistInspector.get_aliases changed<aclass="headerlink" href="#return-type-of-artistinspector-get-aliases-changed" title="Permalink to this headline">¶</a></h3>
<p><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ArtistInspector.get_aliases</span></code> previously returned the set of aliases as
<codeclass="docutils literal notranslate"><spanclass="pre">{fullname:</span><spanclass="pre">{alias1:</span><spanclass="pre">None,</span><spanclass="pre">alias2:</span><spanclass="pre">None,</span><spanclass="pre">...}}</span></code>. The dict-to-None mapping
was used to simulate a set in earlier versions of Python. It has now been
replaced by a set, i.e. <codeclass="docutils literal notranslate"><spanclass="pre">{fullname:</span><spanclass="pre">{alias1,</span><spanclass="pre">alias2,</span><spanclass="pre">...}}</span></code>.</p>
<p>This value is also stored in <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">ArtistInspector.aliasd</span></code>, which has likewise
<h3>Removed <codeclass="docutils literal notranslate"><spanclass="pre">pytz</span></code> as a dependency<aclass="headerlink" href="#removed-pytz-as-a-dependency" title="Permalink to this headline">¶</a></h3>
<p>Since <codeclass="docutils literal notranslate"><spanclass="pre">dateutil</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">pytz</span></code> both provide time zones, and
matplotlib already depends on <codeclass="docutils literal notranslate"><spanclass="pre">dateutil</span></code>, matplotlib will now use
<codeclass="docutils literal notranslate"><spanclass="pre">dateutil</span></code> time zones internally and drop the redundant dependency
on <codeclass="docutils literal notranslate"><spanclass="pre">pytz</span></code>. While <codeclass="docutils literal notranslate"><spanclass="pre">dateutil</span></code> time zones are preferred (and
currently recommended in the Python documentation), the explicit use
of <codeclass="docutils literal notranslate"><spanclass="pre">pytz</span></code> zones is still supported.</p>
</div>
<divclass="section" id="deprecations">
<h3>Deprecations<aclass="headerlink" href="#deprecations" title="Permalink to this headline">¶</a></h3>
<divclass="section" id="modules">
<h4>Modules<aclass="headerlink" href="#modules" title="Permalink to this headline">¶</a></h4>
<p>The following modules are deprecated:</p>
<ulclass="simple">
<li><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.compat.subprocess</span></code>. This was a python 2 workaround, but all
the functionality can now be found in the python 3 standard library
<li><codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.backends.wx_compat</span></code>. Python 3 is only compatible with
wxPython 4, so support for wxPython 3 or earlier can be dropped.</li>
<h4>Classes, methods, functions, and attributes<aclass="headerlink" href="#classes-methods-functions-and-attributes" title="Permalink to this headline">¶</a></h4>
<p>The following classes, methods, functions, and attributes are deprecated:</p>
<li><codeclass="docutils literal notranslate"><spanclass="pre">image._ImageBase.iterpnames</span></code>, use the <codeclass="docutils literal notranslate"><spanclass="pre">interpolation_names</span></code> property
instead. (this affects classes that inherit from <codeclass="docutils literal notranslate"><spanclass="pre">_ImageBase</span></code> including
<li><codeclass="docutils literal notranslate"><spanclass="pre">_ImageBase.iterpnames</span></code>, use the <codeclass="docutils literal notranslate"><spanclass="pre">interpolation_names</span></code> property instead.
(this affects classes that inherit from <codeclass="docutils literal notranslate"><spanclass="pre">_ImageBase</span></code> including
<dd>(<codeclass="docutils literal notranslate"><spanclass="pre">Legend.draggable</span></code> may be reintroduced as a property in future releases)</dd>
<li><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">matplotlib.cbook.deprecation.mplDeprecation</span></code> will be removed
<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">MatplotlibDeprecationWarning</span></code> directly if
neccessary.</li>
<li>The <codeclass="docutils literal notranslate"><spanclass="pre">matplotlib.cbook.Bunch</span></code> class has been deprecated. Instead, use
<aclass="reference external" href="https://docs.python.org/3/library/types.html#types.SimpleNamespace" title="(in Python v3.7)"><codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">types.SimpleNamespace</span></code></a> from the standard library which provides the same
functionality.</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">Axes.mouseover_set</span></code> is now a frozenset, and deprecated. Directly
manipulate the artist's <codeclass="docutils literal notranslate"><spanclass="pre">.mouseover</span></code> attribute to change their mouseover
status.</li>
</ul>
<p>The following keyword arguments are deprecated:</p>
<li>passing <codeclass="docutils literal notranslate"><spanclass="pre">obj_type</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">cbook.deprecated</span></code></li>
</ul>
<p>The following call signatures are deprecated:</p>
<ulclass="simple">
<li>passing a <codeclass="docutils literal notranslate"><spanclass="pre">wx.EvtHandler</span></code> as first argument to <codeclass="docutils literal notranslate"><spanclass="pre">backend_wx.TimerWx</span></code></li>
</ul>
</div>
<divclass="section" id="rcparams">
<h4>rcParams<aclass="headerlink" href="#rcparams" title="Permalink to this headline">¶</a></h4>
<h4>marker styles<aclass="headerlink" href="#marker-styles" title="Permalink to this headline">¶</a></h4>
<ulclass="simple">
<li>Using <codeclass="docutils literal notranslate"><spanclass="pre">(n,</span><spanclass="pre">3)</span></code> as marker style to specify a circle marker is deprecated. Use
<li>Using <codeclass="docutils literal notranslate"><spanclass="pre">([(x0,</span><spanclass="pre">y0),</span><spanclass="pre">(x1,</span><spanclass="pre">y1),</span><spanclass="pre">...],</span><spanclass="pre">0)</span></code> as marker style to specify a custom
marker path is deprecated. Use <codeclass="docutils literal notranslate"><spanclass="pre">[(x0,</span><spanclass="pre">y0),</span><spanclass="pre">(x1,</span><spanclass="pre">y1),</span><spanclass="pre">...]</span></code> instead.</li>
<h4>Deprecation of <codeclass="docutils literal notranslate"><spanclass="pre">LocatableAxes</span></code> in toolkits<aclass="headerlink" href="#deprecation-of-locatableaxes-in-toolkits" title="Permalink to this headline">¶</a></h4>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">LocatableAxes</span></code> classes in toolkits have been deprecated. The base <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">Axes</span></code>
classes provide the same functionality to all subclasses, thus these mixins are
no longer necessary. Related functions have also been deprecated. Specifically:</p>
<ulclass="simple">
<li><codeclass="docutils literal notranslate"><spanclass="pre">mpl_toolkits.axes_grid1.axes_divider.LocatableAxesBase</span></code>: no specific
replacement; use any other <codeclass="docutils literal notranslate"><spanclass="pre">Axes</span></code>-derived class directly instead.</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">mpl_toolkits.axes_grid1.axes_divider.locatable_axes_factory</span></code>: no specific
replacement; use any other <codeclass="docutils literal notranslate"><spanclass="pre">Axes</span></code>-derived class directly instead.</li>
<li><codeclass="docutils literal notranslate"><spanclass="pre">mpl_toolkits.axes_grid1.axes_divider.Axes</span></code>: use
<h3>Removals<aclass="headerlink" href="#removals" title="Permalink to this headline">¶</a></h3>
<divclass="section" id="hold-machinery">
<h4>Hold machinery<aclass="headerlink" href="#hold-machinery" title="Permalink to this headline">¶</a></h4>
<p>Setting or unsetting <codeclass="docutils literal notranslate"><spanclass="pre">hold</span></code> (<aclass="reference internal" href="prev_api_changes/api_changes_2.0.0.html#v200-deprecate-hold"><spanclass="std std-ref">deprecated in version 2.0</span></a>) has now
been completely removed. Matplotlib now always behaves as if <codeclass="docutils literal notranslate"><spanclass="pre">hold=True</span></code>.
To clear an axes you can manually use <aclass="reference internal" href="_as_gen/matplotlib.axes.Axes.cla.html#matplotlib.axes.Axes.cla" title="matplotlib.axes.Axes.cla"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">cla()</span></code></a>,
or to clear an entire figure use <aclass="reference internal" href="_as_gen/matplotlib.figure.Figure.html#matplotlib.figure.Figure.clf" title="matplotlib.figure.Figure.clf"><codeclass="xref py py-meth docutils literal notranslate"><spanclass="pre">clf()</span></code></a>.</p>
<h4>Removal of deprecated backends<aclass="headerlink" href="#removal-of-deprecated-backends" title="Permalink to this headline">¶</a></h4>
<p>Deprecated backends have been removed:</p>
<ulclass="simple">
<li>GTKAgg</li>
<li>GTKCairo</li>
<li>GTK</li>
<li>GDK</li>
</ul>
</div>
<divclass="section" id="deprecated-apis">
<h4>Deprecated APIs<aclass="headerlink" href="#deprecated-apis" title="Permalink to this headline">¶</a></h4>
<p>The following deprecated API elements have been removed:</p>
<ulclass="simple">
<li>The deprecated methods <codeclass="docutils literal notranslate"><spanclass="pre">knownfailureif</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">remove_text</span></code> have been removed
from <codeclass="xref py py-mod docutils literal notranslate"><spanclass="pre">matplotlib.testing.decorators</span></code>.</li>
<li>The entire contents of <codeclass="docutils literal notranslate"><spanclass="pre">testing.noseclasses</span></code> have also been removed.</li>
<h4>Proprietary sphinx directives<aclass="headerlink" href="#proprietary-sphinx-directives" title="Permalink to this headline">¶</a></h4>
<p>The matplotlib documentation used the proprietary sphinx directives
<codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">htmlonly::</span></code>, and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">latexonly::</span></code>. These have been replaced with the
standard sphinx directives <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">only::</span><spanclass="pre">html</span></code> and <codeclass="xref py py-obj docutils literal notranslate"><spanclass="pre">only::</span><spanclass="pre">latex</span></code>. This
change will not affect any users. Only downstream package maintainers, who
have used the proprietary directives in their docs, will have to switch to the