Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4ae4d8

Browse files
committed
DOC: organize API changes
1 parent fd853fa commit c4ae4d8

File tree

1 file changed

+106
-129
lines changed

1 file changed

+106
-129
lines changed

doc/api/api_changes.rst

Lines changed: 106 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -14,114 +14,126 @@ API Changes in 2.2.0
1414
====================
1515

1616
..
17+
1718
.. toctree::
1819
:glob:
1920
:maxdepth: 1
2021

2122
next_api_changes/*
2223

23-
MovieWriterRegistry raises RuntimeError when writer not available
24-
-----------------------------------------------------------------
2524

26-
If `MovieWriterRegistry` can't find the requested `MovieWriter`, a more helpful
27-
`RuntimeError` message is now raised instead of the previously raised
28-
`KeyError`.
25+
Deprecations
26+
------------
2927

28+
Classes, functions, and methods
29+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3030

31-
Using strings instead of booleans to control grid and tick visibility is deprecated
32-
-----------------------------------------------------------------------------------
31+
The unused and untested ``Artist.onRemove`` and ``Artist.hitlist`` methods have
32+
been deprecated.
3333

34-
Using ``"on"``, ``"off"``, ``"true"``, or ``"false"`` to control grid
35-
and tick visibility has been deprecated. Instead, use normal booleans
36-
(``True``/``False``) or boolean-likes. In the future, all non-empty strings
37-
may be interpreted as ``True``.
34+
The now unused ``mlab.less_simple_linear_interpolation`` function is
35+
deprecated.
3836

37+
The unused ``ContourLabeler.get_real_label_width`` method is deprecated.
3938

40-
Removal of deprecated contouring code
41-
-------------------------------------
39+
The unused ``FigureManagerBase.show_popup`` method is deprecated. This
40+
introduced in e945059b327d42a99938b939a1be867fa023e7ba in 2005 but never built
41+
out into any of the backends.
4242

43-
Contouring no longer supports ``legacy`` corner masking.
43+
:class:`backend_tkagg.AxisMenu` is deprecated, as it has become
44+
unused since the removal of "classic" toolbars.
4445

45-
The deprecated ``ContourSet.vmin`` and ``ContourSet.vmax`` properties have been
46-
removed.
4746

47+
Changed function signatures
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
4849

49-
Removal of deprecated features
50-
------------------------------
50+
kwarg ``fig`` to `.GridSpec.get_subplot_params` is
51+
deprecated, use ``figure`` instead.
5152

52-
The ``matplotlib.finance``, ``mpl_toolkits.exceltools`` and
53-
``mpl_toolkits.gtktools`` modules have been removed. ``matplotlib.finance``
54-
remains available at https://github.com/matplotlib/mpl_finance.
53+
Using `.pyplot.axes` with an `.Axes` as argument is deprecated. This sets
54+
the current axes, i.e. it has the same effect as `.pyplot.sca`. For clarity
55+
``plt.sca(ax)`` should be preferred over ``plt.axes(ax)``.
5556

56-
The ``mpl_toolkits.mplot3d.art3d.iscolor`` function has been removed.
5757

58-
The ``Axes.get_axis_bgcolor``, ``Axes.set_axis_bgcolor``,
59-
``Bbox.update_from_data``, ``Bbox.update_datalim_numerix``,
60-
``MaxNLocator.bin_boundaries`` methods have been removed.
58+
Using strings instead of booleans to control grid and tick visibility
59+
is deprecated. Using ``"on"``, ``"off"``, ``"true"``, or ``"false"``
60+
to control grid and tick visibility has been deprecated. Instead, use
61+
normal booleans (``True``/``False``) or boolean-likes. In the future,
62+
all non-empty strings may be interpreted as ``True``.
6163

62-
The ``bgcolor`` keyword argument to ``Axes`` has been removed.
64+
When given 2D inputs with non-matching numbers of columns, `~.pyplot.plot`
65+
currently cycles through the columns of the narrower input, until all the
66+
columns of the wider input have been plotted. This behavior is deprecated; in
67+
the future, only broadcasting (1 column to *n* columns) will be performed.
6368

64-
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
65-
were aliases for the ``tab*`` colormaps, have been removed.
6669

67-
``mencoder`` can no longer be used to encode animations.
70+
rcparams
71+
~~~~~~~~
6872

69-
Passing ``None`` instead of ``"none"`` as format to `~.Axes.errorbar` is no
70-
longer supported.
73+
The :rc:`backend.qt4` and :rc:`backend.qt5` rcParams were deprecated
74+
in version 2.2. In order to force the use of a specific Qt binding,
75+
either import that binding first, or set the ``QT_API`` environment
76+
variable.
7177

78+
Deprecation of the ``nbagg.transparent`` rcParam. To control
79+
transparency of figure patches in the nbagg (or any other) backend,
80+
directly set ``figure.patch.facecolor``, or the ``figure.facecolor``
81+
rcParam.
7282

73-
`Figure.set_figwidth` and `Figure.set_figheight` default forward to True
74-
------------------------------------------------------------------------
7583

76-
`matplotlib.Figure.set_figwidth` and `matplotlib.Figure.set_figheight`
77-
had the kwarg `forward=False`
78-
by default, but `Figure.set_size_inches` now defaults to `forward=True`.
79-
This makes these functions conistent.
8084

85+
Removals
86+
--------
8187

82-
Do not truncate svg sizes to nearest point
83-
------------------------------------------
88+
Function Signatures
89+
~~~~~~~~~~~~~~~~~~~
8490

85-
There is no reason to size the SVG out put in integer points, change
86-
to out putting floats for the *height*, *width*, and *viewBox* attributes
87-
of the *svg* element.
91+
Contouring no longer supports ``legacy`` corner masking. The
92+
deprecated ``ContourSet.vmin`` and ``ContourSet.vmax`` properties have
93+
been removed.
8894

95+
Passing ``None`` instead of ``"none"`` as format to `~.Axes.errorbar` is no
96+
longer supported.
8997

90-
Deprecations
91-
------------
98+
The ``bgcolor`` keyword argument to ``Axes`` has been removed.
9299

93-
The unused and untested ``Artist.onRemove`` and ``Artist.hitlist`` methods have
94-
been deprecated.
100+
Modules, methods, and functions
101+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95102

103+
The ``matplotlib.finance``, ``mpl_toolkits.exceltools`` and
104+
``mpl_toolkits.gtktools`` modules have been removed. ``matplotlib.finance``
105+
remains available at https://github.com/matplotlib/mpl_finance.
96106

97-
Deprecations
98-
------------
107+
The ``mpl_toolkits.mplot3d.art3d.iscolor`` function has been removed.
99108

100-
When given 2D inputs with non-matching numbers of columns, `~.pyplot.plot`
101-
currently cycles through the columns of the narrower input, until all the
102-
columns of the wider input have been plotted. This behavior is deprecated; in
103-
the future, only broadcasting (1 column to *n* columns) will be performed.
109+
The ``Axes.get_axis_bgcolor``, ``Axes.set_axis_bgcolor``,
110+
``Bbox.update_from_data``, ``Bbox.update_datalim_numerix``,
111+
``MaxNLocator.bin_boundaries`` methods have been removed.
104112

113+
``mencoder`` can no longer be used to encode animations.
105114

106-
Deprecations
107-
------------
115+
The unused `FONT_SCALE` and `fontd` attributes of the `RendererSVG`
116+
class have been removed.
108117

109-
The now unused ``mlab.less_simple_linear_interpolation`` function is
110-
deprecated.
118+
color maps
119+
~~~~~~~~~~
111120

121+
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
122+
were aliases for the ``tab*`` colormaps, have been removed.
112123

113-
Deprecation of unused methods
114-
-----------------------------
115124

116-
The unused ``ContourLabeler.get_real_label_width`` method is deprecated.
125+
rcparams
126+
~~~~~~~~
117127

128+
The following deprecated rcParams have been removed:
118129

119-
Deprecations
120-
------------
130+
- ``axes.color_cycle`` (see ``axes.prop_cycle``),
131+
- ``legend.isaxes``,
132+
- ``svg.embed_char_paths`` (see ``svg.fonttype``),
133+
- ``text.fontstyle``, ``text.fontangle``, ``text.fontvariant``,
134+
``text.fontweight``, ``text.fontsize`` (renamed to ``text.style``, etc.),
135+
- ``tick.size`` (renamed to ``tick.major.size``).
121136

122-
The unused ``FigureManagerBase.show_popup`` method is deprecated. This
123-
introduced in e945059b327d42a99938b939a1be867fa023e7ba in 2005 but never built
124-
out into any of the backends.
125137

126138

127139
Removal of unused imports
@@ -132,12 +144,32 @@ trying to import certain classes or functions from the "wrong" module
132144
:mod:`matplotlib.figure`) will now raise an `ImportError`.
133145

134146

135-
Deprecations
136-
------------
147+
Exception type changes
148+
----------------------
137149

138-
Using `.pyplot.axes` with an `.Axes` as argument is deprecated. This sets
139-
the current axes, i.e. it has the same effect as `.pyplot.sca`. For clarity
140-
``plt.sca(ax)`` should be preferred over ``plt.axes(ax)``.
150+
If `MovieWriterRegistry` can't find the requested `MovieWriter`, a
151+
more helpful `RuntimeError` message is now raised instead of the
152+
previously raised `KeyError`.
153+
154+
`~.tight_layout.auto_adjust_subplotpars` now raises `ValueError`
155+
instead of `RuntimeError` when sizes of input lists don't match
156+
157+
158+
`Figure.set_figwidth` and `Figure.set_figheight` default forward to True
159+
------------------------------------------------------------------------
160+
161+
`matplotlib.Figure.set_figwidth` and `matplotlib.Figure.set_figheight`
162+
had the kwarg `forward=False`
163+
by default, but `Figure.set_size_inches` now defaults to `forward=True`.
164+
This makes these functions conistent.
165+
166+
167+
Do not truncate svg sizes to nearest point
168+
------------------------------------------
169+
170+
There is no reason to size the SVG out put in integer points, change
171+
to out putting floats for the *height*, *width*, and *viewBox* attributes
172+
of the *svg* element.
141173

142174

143175
Fontsizes less than 1 pt are clipped to be 1 pt.
@@ -152,36 +184,6 @@ FreeType. This change makes it so no backends can use fonts smaller than
152184
backends.
153185

154186

155-
Deprecation of the ``nbagg.transparent`` rcParam
156-
------------------------------------------------
157-
158-
To control transparency of figure patches in the nbagg (or any other) backend,
159-
directly set ``figure.patch.facecolor``, or the ``figure.facecolor`` rcParam.
160-
161-
162-
Removal of deprecated rcParams
163-
------------------------------
164-
165-
The following deprecated rcParams have been removed:
166-
167-
- ``axes.color_cycle`` (see ``axes.prop_cycle``),
168-
- ``legend.isaxes``,
169-
- ``svg.embed_char_paths`` (see ``svg.fonttype``),
170-
- ``text.fontstyle``, ``text.fontangle``, ``text.fontvariant``,
171-
``text.fontweight``, ``text.fontsize`` (renamed to ``text.style``, etc.),
172-
- ``tick.size`` (renamed to ``tick.major.size``).
173-
174-
175-
`~.tight_layout.auto_adjust_subplotpars` now raises `ValueError` instead of `RuntimeError` when sizes of input lists don't match
176-
--------------------------------------------------------------------------------------------------------------------------------
177-
178-
179-
Deprecation of backend_tkagg.AxisMenu
180-
-------------------------------------
181-
182-
The above-mentioned class is deprecated, as it has become unused since the
183-
removal of "classic" toolbars.
184-
185187

186188
Changes to Qt backend class MRO
187189
-------------------------------
@@ -259,29 +261,13 @@ and ::
259261

260262

261263

262-
Removed attributes
263-
------------------
264-
265-
The unused `FONT_SCALE` and `fontd` attributes of the `RendererSVG` class have
266-
been removed.
267-
268-
269-
API changes for ``constrained_layout``
270-
----------------------------------------
264+
New dependency
265+
--------------
271266

272-
The new constrained_layout functionality has some minor (largely backwards-
273-
compatible) API changes. See
267+
`kiwisolver <https://github.com/nucleic/kiwi>`__ is now a required
268+
dependency to support the new constrained_layout, see
274269
:ref:`sphx_glr_tutorials_intermediate_constrainedlayout_guide.py` for
275-
more details on this functionality.
276-
277-
This requires a new dependency on kiwisolver_.
278-
279-
_https://github.com/nucleic/kiwi
280-
281-
kwarg ``fig`` deprectated in `.GridSpec.get_subplot_params`
282-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
283-
284-
Use ``figure`` instead of ``fig``, which is now deprecated.
270+
more details.
285271

286272

287273
`Axes.imshow` clips RGB values to the valid range
@@ -293,15 +279,6 @@ The old behaviour, wrapping back in to the range, often hid outliers
293279
and made interpreting RGB images unreliable.
294280

295281

296-
Deprecation of qt binding rcparams
297-
----------------------------------
298-
299-
The :rc:`backend.qt4` and :rc:`backend.qt5` rcParams were deprecated
300-
in version 2.2. In order to force the use of a specific Qt binding,
301-
either import that binding first, or set the ``QT_API`` environment
302-
variable.
303-
304-
305282
GTKAgg and GTKCairo backends deprecated
306283
---------------------------------------
307284

0 commit comments

Comments
 (0)