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

Skip to content

Commit fd853fa

Browse files
committed
DOC: merge up api_changes entries into top level api_changes.rst
1 parent b753a4f commit fd853fa

25 files changed

+297
-244
lines changed

doc/api/api_changes.rst

Lines changed: 297 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,304 @@ For new features that were added to Matplotlib, please see
1313
API Changes in 2.2.0
1414
====================
1515

16-
.. toctree::
17-
:glob:
18-
:maxdepth: 1
16+
..
17+
.. toctree::
18+
:glob:
19+
:maxdepth: 1
20+
21+
next_api_changes/*
22+
23+
MovieWriterRegistry raises RuntimeError when writer not available
24+
-----------------------------------------------------------------
25+
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`.
29+
30+
31+
Using strings instead of booleans to control grid and tick visibility is deprecated
32+
-----------------------------------------------------------------------------------
33+
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``.
38+
39+
40+
Removal of deprecated contouring code
41+
-------------------------------------
42+
43+
Contouring no longer supports ``legacy`` corner masking.
44+
45+
The deprecated ``ContourSet.vmin`` and ``ContourSet.vmax`` properties have been
46+
removed.
47+
48+
49+
Removal of deprecated features
50+
------------------------------
51+
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.
55+
56+
The ``mpl_toolkits.mplot3d.art3d.iscolor`` function has been removed.
57+
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.
61+
62+
The ``bgcolor`` keyword argument to ``Axes`` has been removed.
63+
64+
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
65+
were aliases for the ``tab*`` colormaps, have been removed.
66+
67+
``mencoder`` can no longer be used to encode animations.
68+
69+
Passing ``None`` instead of ``"none"`` as format to `~.Axes.errorbar` is no
70+
longer supported.
71+
72+
73+
`Figure.set_figwidth` and `Figure.set_figheight` default forward to True
74+
------------------------------------------------------------------------
75+
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.
80+
81+
82+
Do not truncate svg sizes to nearest point
83+
------------------------------------------
84+
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.
88+
89+
90+
Deprecations
91+
------------
92+
93+
The unused and untested ``Artist.onRemove`` and ``Artist.hitlist`` methods have
94+
been deprecated.
95+
96+
97+
Deprecations
98+
------------
99+
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.
104+
105+
106+
Deprecations
107+
------------
108+
109+
The now unused ``mlab.less_simple_linear_interpolation`` function is
110+
deprecated.
111+
112+
113+
Deprecation of unused methods
114+
-----------------------------
115+
116+
The unused ``ContourLabeler.get_real_label_width`` method is deprecated.
117+
118+
119+
Deprecations
120+
------------
121+
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.
125+
126+
127+
Removal of unused imports
128+
-------------------------
129+
Many unused imports were removed from the codebase. As a result,
130+
trying to import certain classes or functions from the "wrong" module
131+
(e.g. `~.Figure` from :mod:`matplotlib.backends.backend_agg` instead of
132+
:mod:`matplotlib.figure`) will now raise an `ImportError`.
133+
134+
135+
Deprecations
136+
------------
137+
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)``.
141+
142+
143+
Fontsizes less than 1 pt are clipped to be 1 pt.
144+
------------------------------------------------
145+
146+
FreeType doesn't allow fonts to get smaller than 1 pt, so all Agg
147+
backends were silently rounding up to 1 pt. PDF (other vector
148+
backends?) were letting us write fonts that were less than 1 pt, but
149+
they could not be placed properly because position information comes from
150+
FreeType. This change makes it so no backends can use fonts smaller than
151+
1 pt, consistent with FreeType and ensuring more consistent results across
152+
backends.
153+
154+
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+
185+
186+
Changes to Qt backend class MRO
187+
-------------------------------
188+
189+
To support both Agg and cairo rendering for Qt backends all of the
190+
non-Agg specific code previously in
191+
:class:`.backend_qt5agg.FigureCanvasQTAggBase` has been moved to
192+
:class:`.backend_qt5.FigureCanvasQT` so it can be shared with the cairo
193+
implementation. The :meth:`.FigureCanvasQTAggBase.paintEvent`,
194+
:meth:`.FigureCanvasQTAggBase.blit`, and
195+
:meth:`.FigureCanvasQTAggBase.print_figure` methods have moved to
196+
:meth:`.FigureCanvasQTAgg.paintEvent`, :meth:`.FigureCanvasQTAgg.blit`, and
197+
:meth:`.FigureCanvasQTAgg.print_figure`. The first two methods assume that
198+
the instance is also a :class:`QWidget` so to use
199+
:class:`FigureCanvasQTAggBase` it was required to multiple inherit
200+
from a :class:`QWidget` sub-class.
201+
202+
Having moved all of its methods either up or down the class hierarchy
203+
:class:`FigureCanvasQTAggBase` has been deprecated. To do this with
204+
out warning and to preserve as much API as possible,
205+
:class:`.backend_qt5.FigureCanvasQTAggBase` now inherits from
206+
:class:`.backend_qt5.FigureCanvasQTAgg`.
207+
208+
The MRO for :class:`FigureCanvasQTAgg` and
209+
:class:`FigureCanvasQTAggBase` used to be ::
210+
211+
212+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
213+
matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
214+
matplotlib.backends.backend_agg.FigureCanvasAgg,
215+
matplotlib.backends.backend_qt5.FigureCanvasQT,
216+
PyQt5.QtWidgets.QWidget,
217+
PyQt5.QtCore.QObject,
218+
sip.wrapper,
219+
PyQt5.QtGui.QPaintDevice,
220+
sip.simplewrapper,
221+
matplotlib.backend_bases.FigureCanvasBase,
222+
object]
223+
224+
and ::
225+
226+
227+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
228+
matplotlib.backends.backend_agg.FigureCanvasAgg,
229+
matplotlib.backend_bases.FigureCanvasBase,
230+
object]
231+
232+
233+
respectively. They are now ::
234+
235+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
236+
matplotlib.backends.backend_agg.FigureCanvasAgg,
237+
matplotlib.backends.backend_qt5.FigureCanvasQT,
238+
PyQt5.QtWidgets.QWidget,
239+
PyQt5.QtCore.QObject,
240+
sip.wrapper,
241+
PyQt5.QtGui.QPaintDevice,
242+
sip.simplewrapper,
243+
matplotlib.backend_bases.FigureCanvasBase,
244+
object]
245+
246+
and ::
247+
248+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
249+
matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
250+
matplotlib.backends.backend_agg.FigureCanvasAgg,
251+
matplotlib.backends.backend_qt5.FigureCanvasQT,
252+
PyQt5.QtWidgets.QWidget,
253+
PyQt5.QtCore.QObject,
254+
sip.wrapper,
255+
PyQt5.QtGui.QPaintDevice,
256+
sip.simplewrapper,
257+
matplotlib.backend_bases.FigureCanvasBase,
258+
object]
259+
260+
261+
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+
----------------------------------------
271+
272+
The new constrained_layout functionality has some minor (largely backwards-
273+
compatible) API changes. See
274+
: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.
285+
286+
287+
`Axes.imshow` clips RGB values to the valid range
288+
-------------------------------------------------
289+
290+
When `Axes.imshow` is passed an RGB or RGBA value with out-of-range
291+
values, it now logs a warning and clips them to the valid range.
292+
The old behaviour, wrapping back in to the range, often hid outliers
293+
and made interpreting RGB images unreliable.
294+
295+
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+
305+
GTKAgg and GTKCairo backends deprecated
306+
---------------------------------------
307+
308+
The GTKAgg and GTKCairo backends have been deprecated. These obsolete backends
309+
allow figures to be rendered via the GTK+ 2 toolkit. They are untested, known
310+
to be broken, will not work with Python 3, and their use has been discouraged
311+
for some time. Instead, use the `GTK3Agg` and `GTK3Cairo` backends for
312+
rendering to GTK+ 3 windows.
19313

20-
next_api_changes/*
21314

22315

23316
API Changes in 2.1.2

doc/api/api_changes/2017-09-29_JMK_constrained_layout_api.rst

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/api/api_changes/2018-01-26-ZHD.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/api/api_changes/2018-02-04-AL.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/api/api_changes/2018-02-10-ES.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/api/next_api_changes/01-11-2017-DS.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

doc/api/next_api_changes/171225-AL-tickbools.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/api/next_api_changes/2017-09-22-AL-contour.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

doc/api/next_api_changes/2017-09-22-AL-removal-of-deprecated-features.rst

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)