Skip to content

Commit b541a8a

Browse files
authored
Merge pull request #10414 from tacaswell/doc_merge_up_api_whats_new
DOC: merge up api_changes and whats_new
2 parents 98a11ca + 1410c1f commit b541a8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1851
-1173
lines changed

INSTALL.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ Matplotlib requires a large number of dependencies:
181181
(for Python 2.7 only)
182182
* `subprocess32 <https://pypi.python.org/pypi/subprocess32/>`_ (for Python
183183
2.7 only, on Linux and macOS only)
184-
184+
* `kiwisolver <https://github.com/nucleic/kiwi>`__ (>= 1.0.0)
185185

186186
Optionally, you can also install a number of packages to enable better user
187187
interface toolkits. See :ref:`what-is-a-backend` for more details on the
@@ -193,8 +193,10 @@ optional Matplotlib backends and the capabilities they provide.
193193
* `PyQt5 <https://pypi.python.org/pypi/PyQt5>`_: for the Qt5Agg backend;
194194
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend;
195195
* :term:`wxpython` (>= 2.9 or later): for the WX or WXAgg backend;
196+
* `cairocffi <https://cairocffi.readthedocs.io/en/latest/>`__ (>=
197+
v0.8): for cairo based backends;
196198
* `pycairo <https://pypi.python.org/pypi/pycairo>`_: for GTK3Cairo;
197-
* `Tornado <https://pypi.python.org/pypi/tornado>`_: for the WebAgg backend.
199+
* `Tornado <https://pypi.python.org/pypi/tornado>`_: for the WebAgg backend;
198200

199201
For better support of animation output format and image file formats, LaTeX,
200202
etc., you can install the following:

doc/api/api_changes.rst

Lines changed: 274 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,281 @@ 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+
18+
.. toctree::
19+
:glob:
20+
:maxdepth: 1
21+
22+
next_api_changes/*
23+
24+
25+
Deprecations
26+
------------
27+
28+
Classes, functions, and methods
29+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30+
31+
The unused and untested ``Artist.onRemove`` and ``Artist.hitlist`` methods have
32+
been deprecated.
33+
34+
The now unused ``mlab.less_simple_linear_interpolation`` function is
35+
deprecated.
36+
37+
The unused ``ContourLabeler.get_real_label_width`` method is deprecated.
38+
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.
42+
43+
:class:`backend_tkagg.AxisMenu` is deprecated, as it has become
44+
unused since the removal of "classic" toolbars.
45+
46+
47+
Changed function signatures
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
49+
50+
kwarg ``fig`` to `.GridSpec.get_subplot_params` is
51+
deprecated, use ``figure`` instead.
52+
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)``.
56+
57+
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``.
63+
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.
68+
69+
70+
rcparams
71+
~~~~~~~~
72+
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.
77+
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.
82+
83+
84+
85+
Removals
86+
--------
87+
88+
Function Signatures
89+
~~~~~~~~~~~~~~~~~~~
90+
91+
Contouring no longer supports ``legacy`` corner masking. The
92+
deprecated ``ContourSet.vmin`` and ``ContourSet.vmax`` properties have
93+
been removed.
94+
95+
Passing ``None`` instead of ``"none"`` as format to `~.Axes.errorbar` is no
96+
longer supported.
97+
98+
The ``bgcolor`` keyword argument to ``Axes`` has been removed.
99+
100+
Modules, methods, and functions
101+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102+
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.
106+
107+
The ``mpl_toolkits.mplot3d.art3d.iscolor`` function has been removed.
108+
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.
112+
113+
``mencoder`` can no longer be used to encode animations.
114+
115+
The unused `FONT_SCALE` and `fontd` attributes of the `RendererSVG`
116+
class have been removed.
117+
118+
color maps
119+
~~~~~~~~~~
120+
121+
The ``spectral`` colormap has been removed. The ``Vega*`` colormaps, which
122+
were aliases for the ``tab*`` colormaps, have been removed.
123+
124+
125+
rcparams
126+
~~~~~~~~
127+
128+
The following deprecated rcParams have been removed:
129+
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``).
136+
137+
138+
139+
Removal of unused imports
140+
-------------------------
141+
Many unused imports were removed from the codebase. As a result,
142+
trying to import certain classes or functions from the "wrong" module
143+
(e.g. `~.Figure` from :mod:`matplotlib.backends.backend_agg` instead of
144+
:mod:`matplotlib.figure`) will now raise an `ImportError`.
145+
146+
147+
Exception type changes
148+
----------------------
149+
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.
173+
174+
175+
Fontsizes less than 1 pt are clipped to be 1 pt.
176+
------------------------------------------------
177+
178+
FreeType doesn't allow fonts to get smaller than 1 pt, so all Agg
179+
backends were silently rounding up to 1 pt. PDF (other vector
180+
backends?) were letting us write fonts that were less than 1 pt, but
181+
they could not be placed properly because position information comes from
182+
FreeType. This change makes it so no backends can use fonts smaller than
183+
1 pt, consistent with FreeType and ensuring more consistent results across
184+
backends.
185+
186+
187+
188+
Changes to Qt backend class MRO
189+
-------------------------------
190+
191+
To support both Agg and cairo rendering for Qt backends all of the
192+
non-Agg specific code previously in
193+
:class:`.backend_qt5agg.FigureCanvasQTAggBase` has been moved to
194+
:class:`.backend_qt5.FigureCanvasQT` so it can be shared with the cairo
195+
implementation. The :meth:`.FigureCanvasQTAggBase.paintEvent`,
196+
:meth:`.FigureCanvasQTAggBase.blit`, and
197+
:meth:`.FigureCanvasQTAggBase.print_figure` methods have moved to
198+
:meth:`.FigureCanvasQTAgg.paintEvent`, :meth:`.FigureCanvasQTAgg.blit`, and
199+
:meth:`.FigureCanvasQTAgg.print_figure`. The first two methods assume that
200+
the instance is also a :class:`QWidget` so to use
201+
:class:`FigureCanvasQTAggBase` it was required to multiple inherit
202+
from a :class:`QWidget` sub-class.
203+
204+
Having moved all of its methods either up or down the class hierarchy
205+
:class:`FigureCanvasQTAggBase` has been deprecated. To do this with
206+
out warning and to preserve as much API as possible,
207+
:class:`.backend_qt5.FigureCanvasQTAggBase` now inherits from
208+
:class:`.backend_qt5.FigureCanvasQTAgg`.
209+
210+
The MRO for :class:`FigureCanvasQTAgg` and
211+
:class:`FigureCanvasQTAggBase` used to be ::
212+
213+
214+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
215+
matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
216+
matplotlib.backends.backend_agg.FigureCanvasAgg,
217+
matplotlib.backends.backend_qt5.FigureCanvasQT,
218+
PyQt5.QtWidgets.QWidget,
219+
PyQt5.QtCore.QObject,
220+
sip.wrapper,
221+
PyQt5.QtGui.QPaintDevice,
222+
sip.simplewrapper,
223+
matplotlib.backend_bases.FigureCanvasBase,
224+
object]
225+
226+
and ::
227+
228+
229+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
230+
matplotlib.backends.backend_agg.FigureCanvasAgg,
231+
matplotlib.backend_bases.FigureCanvasBase,
232+
object]
233+
234+
235+
respectively. They are now ::
236+
237+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
238+
matplotlib.backends.backend_agg.FigureCanvasAgg,
239+
matplotlib.backends.backend_qt5.FigureCanvasQT,
240+
PyQt5.QtWidgets.QWidget,
241+
PyQt5.QtCore.QObject,
242+
sip.wrapper,
243+
PyQt5.QtGui.QPaintDevice,
244+
sip.simplewrapper,
245+
matplotlib.backend_bases.FigureCanvasBase,
246+
object]
247+
248+
and ::
249+
250+
[matplotlib.backends.backend_qt5agg.FigureCanvasQTAggBase,
251+
matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg,
252+
matplotlib.backends.backend_agg.FigureCanvasAgg,
253+
matplotlib.backends.backend_qt5.FigureCanvasQT,
254+
PyQt5.QtWidgets.QWidget,
255+
PyQt5.QtCore.QObject,
256+
sip.wrapper,
257+
PyQt5.QtGui.QPaintDevice,
258+
sip.simplewrapper,
259+
matplotlib.backend_bases.FigureCanvasBase,
260+
object]
261+
262+
263+
264+
New dependency
265+
--------------
266+
267+
`kiwisolver <https://github.com/nucleic/kiwi>`__ is now a required
268+
dependency to support the new constrained_layout, see
269+
:ref:`sphx_glr_tutorials_intermediate_constrainedlayout_guide.py` for
270+
more details.
271+
272+
273+
`Axes.imshow` clips RGB values to the valid range
274+
-------------------------------------------------
275+
276+
When `Axes.imshow` is passed an RGB or RGBA value with out-of-range
277+
values, it now logs a warning and clips them to the valid range.
278+
The old behaviour, wrapping back in to the range, often hid outliers
279+
and made interpreting RGB images unreliable.
280+
281+
282+
GTKAgg and GTKCairo backends deprecated
283+
---------------------------------------
284+
285+
The GTKAgg and GTKCairo backends have been deprecated. These obsolete backends
286+
allow figures to be rendered via the GTK+ 2 toolkit. They are untested, known
287+
to be broken, will not work with Python 3, and their use has been discouraged
288+
for some time. Instead, use the `GTK3Agg` and `GTK3Cairo` backends for
289+
rendering to GTK+ 3 windows.
19290

20-
next_api_changes/*
21291

22292

23293
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)