8000 Clean up next api_changes by dstansby · Pull Request #11633 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Clean up next api_changes #11633

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 2 commits into from
Jul 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 77 additions & 78 deletions doc/api/api_changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ Drop support for python 2
Matplotlib 3 only supports python 10000 3.5 and higher


Hold machinery removed
----------------------

Setting or unsetting ``hold`` (deprecated in version 2.1) has now
been completely removed. Matplotlib now always behaves as if ``hold=True``.
To clear an axes you can manually use :meth:`~.axes.Axes.cla()`,
or to clear an entire figure use :meth:`~.figure.Figure.clf()`.


`.Axes.hist2d` now uses `~.Axes.pcolormesh` instead of `~.Axes.pcolorfast`
--------------------------------------------------------------------------

Expand Down Expand Up @@ -61,46 +70,51 @@ The following classes, methods, functions, and attributes are deprecated:

- ``RcParams.msg_depr``, ``RcParams.msg_depr_ignore``,
``RcParams.msg_depr_set``, ``RcParams.msg_obsolete``,
``RcParams.msg_backend_obsolete``,
- ``afm.parse_afm``,
- ``backend_pgf.get_texcommand``,
- ``backend_ps.get_bbox``,
- ``backend_qt5.error_msg_qt``, ``backend_qt5.exception_handler``,
- ``backend_wx.FigureCanvasWx.macros``,
- ``cbook.GetRealpathAndStat``, ``cbook.Locked``,
``RcParams.msg_backend_obsolete``
- ``afm.parse_afm``
- ``backend_pgf.get_texcommand``
- ``backend_ps.get_bbox``
- ``backend_qt5.error_msg_qt``, ``backend_qt5.exception_handler``
- ``backend_wx.FigureCanvasWx.macros``
- ``cbook.GetRealpathAndStat``, ``cbook.Locked``
- ``cbook.is_numlike`` (use ``isinstance(..., numbers.Number)`` instead),
``cbook.listFiles``, ``cbook.unicode_safe``,
- ``container.Container.set_remove_method``,
- ``contour.ContourLabeler.cl``, ``.cl_xy``, and ``.cl_cvalues``,
- ``dates.DateFormatter.strftime_pre_1900``, ``dates.DateFormatter.strftime``,
- ``font_manager.TempCache``,
- ``mathtext.unichr_safe`` (use ``chr`` instead),
- ``table.Table.get_child_artists`` (use ``get_children`` instead),
``cbook.listFiles``, ``cbook.unicode_safe``
- ``container.Container.set_remove_method``
- ``contour.ContourLabeler.cl``, ``.cl_xy``, and ``.cl_cvalues``
- ``dates.DateFormatter.strftime_pre_1900``, ``dates.DateFormatter.strftime``
- ``font_manager.TempCache``
- ``mathtext.unichr_safe`` (use ``chr`` instead)
- ``table.Table.get_child_artists`` (use ``get_children`` instead)
- ``testing.compare.ImageComparisonTest``, ``testing.compare.compare_float``,
- ``testing.decorators.CleanupTest``,
``testing.decorators.skip_if_command_unavailable``,
- ``testing.decorators.CleanupTest``
``testing.decorators.skip_if_command_unavailable``
- ``FigureCanvasQT.keyAutoRepeat`` (directly check
``event.guiEvent.isAutoRepeat()`` in the event handler to decide whether to
handle autorepeated key presses).
- ``FigureCanvasWx.macros``,
handle autorepeated key presses)
- ``FigureCanvasWx.macros``
- ``_ImageBase.iterpnames``, use the ``interpolation_names`` property instead.
(this affects classes that inherit from ``_ImageBase`` including
:class:`FigureImage`, :class:`BboxImage`, and :class:`AxesImage`),
- ``patches.Polygon.xy``,
- ``texmanager.dvipng_hack_alpha``,
- ``text.Annotation.arrow``,
:class:`FigureImage`, :class:`BboxImage`, and :class:`AxesImage`)
- ``patches.Polygon.xy``
- ``texmanager.dvipng_hack_alpha``
- ``text.Annotation.arrow``
- `.Legend.draggable()`, in favor of `.Legend.set_draggable()`
(``Legend.draggable`` may be reintroduced as a property in future releases)


The following rcParams are deprecated:
- ``examples.directory`` (use ``datapath`` instead),
- ``pgf.debug`` (the pgf backend relies on logging),
- ``text.latex.unicode``,

- ``examples.directory`` (use ``datapath`` instead)
- ``pgf.debug`` (the pgf backend relies on logging)
- ``text.latex.unicode``

The following keyword arguments are deprecated:
- passing ``verts`` to ``Axes.scatter`` (use ``marker`` instead),
- passing ``obj_type`` to ``cbook.deprecated``,

- passing ``verts`` to ``Axes.scatter`` (use ``marker`` instead)
- passing ``obj_type`` to ``cbook.deprecated``

The following call signatures are deprecated:
- passing a ``wx.EvtHandler`` as first argument to ``backend_wx.TimerWx``,
- passing a ``wx.EvtHandler`` as first argument to ``backend_wx.TimerWx``

Deprecated methods removed from `matplotlib.testing`
----------------------------------------------------
Expand All @@ -111,6 +125,15 @@ from :mod:`matplotlib.testing.decorators`.
The entire contents of `testing.noseclasses` have also been removed.


``matplotlib.cbook.deprecation.mplDeprecation`` is deprecated
-------------------------------------------------------------

:class:`matplotlib.cbook.deprecation.mplDeprecation` will be removed in
future versions. It is just an alias for
:class:`matplotlib.cbook.deprecation.MatplotlibDeprecationWarning`.
Please use the :class:`~.MatplotlibDeprecationWarning` directly if neccessary.


matplotlib.cbook.Bunch deprecated
---------------------------------

Expand All @@ -119,6 +142,16 @@ The ``matplotlib.cbook.Bunch`` class has been deprecated. Instead, use
functionality.


Deprecation of certain marker styles
------------------------------------

Using ``(n, 3)`` as marker style to specify a circle marker is deprecated. Use
``"o"`` instead.

Using ``([(x0, y0), (x1, y1), ...], 0)`` as marker style to specify a custom
marker path is deprecated. Use ``[(x0, y0), (x1, y1), ...]`` instead.


Removal of deprecated backends
------------------------------

Expand All @@ -130,15 +163,6 @@ Deprecated backends have been removed:
* GDK


Hold machinery removed
----------------------

Setting or unsetting ``hold`` (deprecated in version 2.1) has now
been completely removed. Matplotlib now always behaves as if ``hold=True``.
To clear an axes you can manually use :meth:`~.axes.Axes.cla()`,
or to clear an entire figure use :meth:`~.figure.Figure.clf()`.


``Axes3D.get_xlim``, ``get_ylim`` and ``get_zlim`` now return a tuple
---------------------------------------------------------------------

Expand Down Expand Up @@ -213,16 +237,6 @@ These arguments were renamed in 2.0 to ``x``/``y`` following the change of the
default alignment from ``edge`` to ``center``.


Deprecation of certain marker styles
------------------------------------

Using ``(n, 3)`` as marker style to specify a circle marker is deprecated. Use
``"o"`` instead.

Using ``([(x0, y0), (x1, y1), ...], 0)`` as marker style to specify a custom
marker path is deprecated. Use ``[(x0, y0), (x1, y1), ...]`` instead.


Different exception types for undocumented options
--------------------------------------------------

Expand All @@ -243,7 +257,7 @@ Improved call signature for Axes.margins()
------------------------------------------

:meth:`matplotlib.axes.Axes.margins` and :meth:`mpl_toolkits.mplot3d.Axes3D.margins`
no longer accept arbitrary keywords. ``TypeError`` will therefore be raised
no longer accept arbitrary keywords. ``TypeError`` will therefore be raised
if unknown kwargs are passed; previously they would be silently ignored.

If too many positional arguments are passed, ``TypeError`` will be raised
Expand All @@ -254,8 +268,8 @@ warning if only two positional arguments are passed. To supply only ``x`` and
``y`` margins, use keyword arguments.


Remove lib/mpl_examples
-----------------------
lib/mpl_examples removed
------------------------

The symlink from lib/mpl_examples to ../examples has been removed.
This is not installed as an importable package and should not affect
Expand Down Expand Up @@ -287,20 +301,12 @@ unhandled positional arguments. If two or more arguments are passed
will be raised instead of treating X as Y and Y as linefmt.


``matplotlib.cbook.deprecation.mplDeprecation`` is deprecated
-------------------------------------------------------------

:class:`matplotlib.cbook.deprecation.mplDeprecation` will be removed in
future versions. It is just an alias for
:class:`matplotlib.cbook.deprecation.MatplotlibDeprecationWarning`.
Please use the :class:`~.MatplotlibDeprecationWarning` directly if neccessary.

Cleanup decorators and test classes no longer destroy warnings filter on exit
-----------------------------------------------------------------------------

The cleanup decorators and test 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 ``warnings.catch_warnings``.
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 ``warnings.catch_warnings``.


Non-interactive FigureManager classes are now aliases of FigureManagerBase
Expand All @@ -315,13 +321,13 @@ adding or overriding any attribute or method), are now direct aliases for
Change to the output of `.image.thumbnail`
------------------------------------------

When called with ``preview=False``, ``image.thumbnail`` previously returned an
When called with ``preview=False``, `.image.thumbnail` 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 `FigureCanvasBase` (and
relies on `FigureCanvasBase.print_figure`) to handle the canvas switching
properly).

As a side effect of this change, `image.thumbnail` now also supports .ps, .eps,
As a side effect of this change, `.image.thumbnail` now also supports .ps, .eps,
and .svgz output.


Expand Down Expand Up @@ -376,7 +382,7 @@ Changes to backend loading

Failure to load backend modules (``macosx`` on non-framework builds and
``gtk3`` when running headless) now raises `ImportError` (instead of
`RuntimeError` and `TypeError`, respectively.
`RuntimeError` and `TypeError`, respectively).

Third-party backends that integrate with an interactive framework are now
encouraged to define the ``required_interactive_framework`` global value to one
Expand All @@ -386,11 +392,11 @@ backend to another (specifically, whether they use the same interactive
framework).


Changed default `AutoDateLocator` kwarg ``interval_multiples`` to ``True``
--------------------------------------------------------------------------
Changed default `AutoDateLocator` kwarg *interval_multiples* to ``True``
------------------------------------------------------------------------

The default value of the tick locator for dates, `.dates.AutoDateLocator`
kwarg ``interval_multiples`` was set to ``False`` which leads to not-nice
kwarg *interval_multiples* was set to ``False`` which leads to not-nice
looking automatic ticks in many instances. The much nicer
``interval_multiples=True`` is the new default. See below to get the
old behavior back:
Expand Down Expand Up @@ -430,9 +436,9 @@ old behavior back:

`.Axes.get_position` used to return the original position unless a
draw had been triggered or `.Axes.apply_aspect` had been called, even
if the kwarg *original* was set to *False*. Now `.Axes.apply_aspect`
if the kwarg *original* was set to ``False``. Now `.Axes.apply_aspect`
is called so ``ax.get_position()`` will return the new modified position.
To get the old behaviour, ``ax.get_position(original=True)``.
To get the old behaviour use ``ax.get_position(original=True)``.


The ticks for colorbar now adjust for the size of the colorbar
Expand All @@ -444,13 +450,6 @@ doesn't have a BoundaryNorm, or boundaries are not specified.
If boundaries, etc are specified, the colorbar maintains the
original behaviour.


Deprecations
------------

`.Legend.draggable()` is drepecated in favor of `.Legend.set_draggable()`.
``Legend.draggable`` may be reintroduced as a property in future releases.

Colorbar for log-scaled hexbin
------------------------------

Expand Down
0