-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove remaining 3.8 deprecations #28874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
Passing extra positional arguments to ``Figure.add_axes`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Positional arguments passed to `.Figure.add_axes` other than a rect or an existing | ||
``Axes`` were previously ignored, and is now an error. | ||
|
||
|
||
Artists explicitly passed in will no longer be filtered by legend() based on their label | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Previously, artists explicitly passed to ``legend(handles=[...])`` are filtered out if | ||
their label starts with an underscore. This filter is no longer applied; explicitly | ||
filter out such artists (``[art for art in artists if not | ||
art.get_label().startswith('_')]``) if necessary. | ||
|
||
Note that if no handles are specified at all, then the default still filters out labels | ||
starting with an underscore. | ||
|
||
|
||
The parameter of ``Annotation.contains`` and ``Legend.contains`` is renamed to *mouseevent* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... consistently with `.Artist.contains`. | ||
|
||
|
||
Support for passing the "frac" key in ``annotate(..., arrowprops={"frac": ...})`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... has been removed. This key has had no effect since Matplotlib 1.5. | ||
|
||
|
||
Passing non-int or sequence of non-int to ``Table.auto_set_column_width`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Column numbers are ints, and formerly passing any other type was effectively ignored. | ||
This has now become an error. | ||
|
||
|
||
Widgets | ||
~~~~~~~ | ||
|
||
The *visible* attribute getter of ``*Selector`` widgets has been removed; use | ||
``get_visible`` instead. | ||
|
||
|
||
Auto-closing of figures when switching backend | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Allowable backend switches (i.e. those that do not swap a GUI event loop with another | ||
one) will not close existing figures. If necessary, call ``plt.close("all")`` before | ||
switching. | ||
|
||
|
||
``FigureCanvasBase.switch_backends`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... has been removed with no replacement. | ||
|
||
|
||
Accessing ``event.guiEvent`` after event handlers return | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... is no longer supported, and ``event.guiEvent`` will be set to None once the event | ||
handlers return. For some GUI toolkits, it is unsafe to use the event, though you may | ||
separately stash the object at your own risk. | ||
|
||
|
||
``PdfPages(keep_empty=True)`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
A zero-page PDF is not valid, thus passing ``keep_empty=True`` to `.backend_pdf.PdfPages` | ||
and `.backend_pgf.PdfPages`, and the ``keep_empty`` attribute of these classes, is no | ||
longer allowed, and empty PDF files will not be created. | ||
|
||
Furthermore, `.backend_pdf.PdfPages` no longer immediately creates the target file upon | ||
instantiation, but only when the first figure is saved. To fully control file creation, | ||
directly pass an opened file object as argument (``with open(path, "wb") as file, | ||
PdfPages(file) as pdf: ...``). | ||
|
||
|
||
``backend_ps.psDefs`` | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ``psDefs`` module-level variable in ``backend_ps`` has been removed with no | ||
replacement. | ||
|
||
|
||
Automatic papersize selection in PostScript | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Setting :rc:`ps.papersize` to ``'auto'`` or passing ``papersize='auto'`` to | ||
`.Figure.savefig` is no longer supported. Either pass an explicit paper type name, or | ||
omit this parameter to use the default from the rcParam. | ||
|
||
|
||
``RendererAgg.tostring_rgb`` and ``FigureCanvasAgg.tostring_rgb`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... have been remove with no direct replacement. Consider using ``buffer_rgba`` instead, | ||
which should cover most use cases. | ||
|
||
|
||
``NavigationToolbar2QT.message`` has been removed | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... with no replacement. | ||
|
||
|
||
``TexManager.texcache`` | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
... is considered private and has been removed. The location of the cache directory is | ||
clarified in the doc-string. | ||
|
||
|
||
``cbook`` API changes | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
``cbook.Stack`` has been removed with no replacement. | ||
|
||
``Grouper.clean()`` has been removed with no replacement. The Grouper class now cleans | ||
itself up automatically. | ||
|
||
The *np_load* parameter of ``cbook.get_sample_data`` has been removed; `.get_sample_data` | ||
now auto-loads numpy arrays. Use ``get_sample_data(..., asfileobj=False)`` instead to get | ||
the filename of the data file, which can then be passed to `open`, if desired. | ||
|
||
|
||
Calling ``paths.get_path_collection_extents`` with empty *offsets* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Calling `~.get_path_collection_extents` with an empty *offsets* parameter has an | ||
ambiguous interpretation and is no longer allowed. | ||
|
||
|
||
``bbox.anchored()`` with no explicit container | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Not passing a *container* argument to `.BboxBase.anchored` is no longer supported. | ||
|
||
|
||
``INVALID_NON_AFFINE``, ``INVALID_AFFINE``, ``INVALID`` attributes of ``TransformNode`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
These attributes have been removed. | ||
|
||
|
||
``axes_grid1`` API changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
``anchored_artists.AnchoredEllipse`` has been removed. Instead, directly construct an | ||
`.AnchoredOffsetbox`, an `.AuxTransformBox`, and an `~.patches.Ellipse`, as demonstrated | ||
in :doc:`/gallery/misc/anchored_artists`. | ||
|
||
The ``axes_divider.AxesLocator`` class has been removed. The ``new_locator`` method of | ||
divider instances now instead returns an opaque callable (which can still be passed to | ||
``ax.set_axes_locator``). | ||
|
||
``axes_divider.Divider.locate`` has been removed; use ``Divider.new_locator(...)(ax, | ||
renderer)`` instead. | ||
|
||
``axes_grid.CbarAxesBase.toggle_label`` has been removed. Instead, use standard methods | ||
for manipulating colorbar labels (`.Colorbar.set_label`) and tick labels | ||
(`.Axes.tick_params`). | ||
|
||
``inset_location.InsetPosition`` has been removed; use `~.Axes.inset_axes` instead. | ||
|
||
|
||
``axisartist`` API changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ``axisartist.axes_grid`` and ``axisartist.axes_rgb`` modules, which provide wrappers | ||
combining the functionality of `.axes_grid1` and `.axisartist`, have been removed; | ||
directly use e.g. ``AxesGrid(..., axes_class=axislines.Axes)`` instead. | ||
|
||
Calling an axisartist Axes to mean `~matplotlib.pyplot.axis` has been removed; explicitly | ||
call the method instead. | ||
|
||
``floating_axes.GridHelperCurveLinear.get_data_boundary`` has been removed. Use | ||
``grid_finder.extreme_finder(*[None] * 5)`` to get the extremes of the grid. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is a bit weird to have here in the public API when the
cbook.Stack
is going away. mypy doesn't like this since it's not incbook.pyi
. Is this really something that should be public?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed on the call today and decided to keep
cbook._Stack
in the type stubs to keep this working. If we want, then probably could also deprecate access to these attributes as they are probably internal.