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

Skip to content

Commit 6d97f09

Browse files
efiringtacaswell
authored andcommitted
DOC: cleanups in api_changes for v1.5 and later
1 parent 89add4c commit 6d97f09

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

doc/api/api_changes.rst

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
=============
55

66
Log of changes to matplotlib that affect the outward-facing API. If
7-
updating matplotlib breaks your scripts, this list may help describe
8-
what changes may be necessary in your code or help figure out possible
9-
sources of the changes you are experiencing.
7+
updating matplotlib breaks your scripts, this list may help you figure
8+
out what caused the breakage and how to fix it by updating your code.
109

1110
For new features that were added to matplotlib, please see
1211
:ref:`whats-new`.
@@ -20,30 +19,26 @@ Deprecation and removal
2019

2120
Color of Axes
2221
~~~~~~~~~~~~~
23-
2422
The ``axisbg`` and ``axis_bgcolor`` properties on ``Axes`` have been
2523
deprecated in favor of ``facecolor``.
2624

2725

2826
GTK and GDK backends deprecated
2927
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30-
The untested and broken GDK and GTK backends have been deprecated.
31-
These backends allows figures to be rendered via the GDK api to
32-
files and GTK2 figures. They are untested, known to be broken and
33-
use have been discouraged for some time. The `GTKAgg` and `GTKCairo` backends
34-
provide better and more tested ways of rendering figures to GTK2 windows.
28+
The GDK and GTK backends have been deprecated. These obsolete backends
29+
allow figures to be rendered via the GDK API to files and GTK2 figures.
30+
They are untested and known to be broken, and their use has been
31+
discouraged for some time. Instead, use the `GTKAgg` and `GTKCairo`
32+
backends for rendering to GTK2 windows.
3533

3634
WX backend deprecated
3735
~~~~~~~~~~~~~~~~~~~~~
38-
The untested WX backend has been deprecated.
39-
This backend allows figures to be rendered via the WX api to
40-
files and Wx figures. It is untested, and
41-
use have been discouraged for some time. The `WXAgg` backend
42-
provides a better and more tested way of rendering figures to WX windows.
36+
The WX backend has been deprecated. It is untested, and its
37+
use has been discouraged for some time. Instead, use the `WXAgg`
38+
backend for rendering figures to WX windows.
4339

4440
CocoaAgg backend removed
4541
~~~~~~~~~~~~~~~~~~~~~~~~
46-
4742
The deprecated and not fully functional CocoaAgg backend has been removed.
4843

4944

@@ -56,16 +51,15 @@ now use a common codepath to look up how to update the given artist
5651
properties (either using the setter methods or an attribute/property).
5752

5853
The behavior of `matplotlib.Artist.update` is slightly changed to
59-
return a list of the returned values from the setter methods to avoid
54+
return a list of the values returned from the setter methods to avoid
6055
changing the API of `matplotlib.Artist.set` and
6156
`matplotlib.artist.setp`.
6257

6358
The keys passed into `matplotlib.Artist.update` are now converted to
64-
lower case before being processed to match the behavior of
59+
lower case before being processed, to match the behavior of
6560
`matplotlib.Artist.set` and `matplotlib.artist.setp`. This should not
6661
break any user code because there are no set methods with capitals in
67-
the names, however going forward this puts a constraint on naming
68-
properties.
62+
their names, but this puts a constraint on naming properties in the future.
6963

7064

7165
`Legend` initializers gain edgecolor and facecolor kwargs
@@ -108,18 +102,19 @@ See the ``draw_image`` docstring for more information.
108102
`matplotlib.ticker.LinearLocator` algorithm update
109103
--------------------------------------------------
110104

111-
The ``matplotlib.ticker.LinearLocator`` is used to define the range and location
112-
of tick marks of a plot when the user wants an exact number of ticks.
113-
``LinearLocator`` thus differs from the default locator ``MaxNLocator``, which
114-
does not necessarily return the exact user requested number of ticks.
105+
The ``matplotlib.ticker.LinearLocator`` is used to define the range and
106+
location of axis ticks when the user wants an exact number of ticks.
107+
``LinearLocator`` thus differs from the default locator ``MaxNLocator``,
108+
for which the user specifies a maximum number of intervals rather than
109+
a precise number of ticks.
115110

116111
The view range algorithm in ``matplotlib.ticker.LinearLocator`` has been
117112
changed so that more convenient tick locations are chosen. The new algorithm
118113
returns a plot view range that is a multiple of the user-requested number of
119114
ticks. This ensures tick marks will be located at whole integers more
120115
consistently. For example, when both y-axes of a``twinx`` plot use
121-
``matplotlib.ticker.LinearLocator`` with the same number of ticks, the grids of
122-
both axis will be properly aligned at convenient tick locations.
116+
``matplotlib.ticker.LinearLocator`` with the same number of ticks,
117+
their y-tick locations and grid lines will coincide.
123118

124119

125120
New defaults for 3D quiver function in mpl_toolkits.mplot3d.axes3d.py
@@ -175,34 +170,34 @@ Changes in 1.5.0
175170
Code Changes
176171
------------
177172

178-
Split `matplotlib.cbook.ls_mapper` in two
179-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173+
Reversed `matplotlib.cbook.ls_mapper`, added `ls_mapper_r`
174+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180175

181-
The ``matplotlib.cbook.ls_mapper`` dictionary is split into two now to
182-
distinguish between qualified linestyle used by backends and
183-
unqualified ones. `ls_mapper` now maps from the short symbols
184-
(e.g. `"--"`) to qualified names (`"solid"`). The new ls_mapper_r is
185-
the reversed mapping.
176+
Formerly, `matplotlib.cbook.ls_mapper` was a dictionary with
177+
the long-form line-style names (`"solid"`) as keys and the short
178+
forms (`"-"`) as values. This long-to-short mapping is now done
179+
by `ls_mapper_r`, and the short-to-long mapping is done by the
180+
`ls_mapper`.
186181

187182
Prevent moving artists between Axes, Property-ify Artist.axes, deprecate Artist.{get,set}_axes
188183
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189184

190-
The reason this was done was to prevent adding an Artist that is
191-
already associated with an Axes to be moved/added to a different Axes.
185+
This was done to prevent an Artist that is
186+
already associated with an Axes from being moved/added to a different Axes.
192187
This was never supported as it causes havoc with the transform stack.
193188
The apparent support for this (as it did not raise an exception) was
194189
the source of multiple bug reports and questions on SO.
195190

196191
For almost all use-cases, the assignment of the axes to an artist should be
197192
taken care of by the axes as part of the ``Axes.add_*`` method, hence the
198-
deprecation {get,set}_axes.
193+
deprecation of {get,set}_axes.
199194

200195
Removing the ``set_axes`` method will also remove the 'axes' line from
201196
the ACCEPTS kwarg tables (assuming that the removal date gets here
202197
before that gets overhauled).
203198

204-
Tighted input validation on 'pivot' kwarg to quiver
205-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199+
Tightened input validation on 'pivot' kwarg to quiver
200+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206201

207202
Tightened validation so that only {'tip', 'tail', 'mid', and 'middle'}
208203
(but any capitalization) are valid values for the 'pivot' kwarg in
@@ -253,20 +248,20 @@ Added set_params function to all Locator types
253248
This was a bug fix targeted at making the api for Locators more consistent.
254249

255250
In the old behavior, only locators of type MaxNLocator have set_params()
256-
defined, causing its use on any other Locator to throw an AttributeError *(
251+
defined, causing its use on any other Locator to raise an AttributeError *(
257252
aside: set_params(args) is a function that sets the parameters of a Locator
258253
instance to be as specified within args)*. The fix involves moving set_params()
259254
to the Locator class such that all subtypes will have this function defined.
260255

261-
Since each of the Locator subtype have their own modifiable parameters, a
256+
Since each of the Locator subtypes have their own modifiable parameters, a
262257
universal set_params() in Locator isn't ideal. Instead, a default no-operation
263258
function that raises a warning is implemented in Locator. Subtypes extending
264259
Locator will then override with their own implementations. Subtypes that do
265260
not have a need for set_params() will fall back onto their parent's
266261
implementation, which raises a warning as intended.
267262

268-
In the new behavior, all Locator instances will not throw an AttributeError
269-
when set_param() is called. For Locators that do not implement set_params(),
263+
In the new behavior, Locator instances will not raise an AttributeError
264+
when set_params() is called. For Locators that do not implement set_params(),
270265
the default implementation in Locator is used.
271266

272267
Disallow ``None`` as x or y value in ax.plot
@@ -291,8 +286,8 @@ Removed `args` and `kwargs` from `MicrosecondLocator.__call__`
291286

292287
The call signature of :meth:`~matplotlib.dates.MicrosecondLocator.__call__`
293288
has changed from `__call__(self, *args, **kwargs)` to `__call__(self)`.
294-
This is consistent with the super class :class:`~matplotlib.ticker.Locator`
295-
and also all the other Locators derived from this super class.
289+
This is consistent with the superclass :class:`~matplotlib.ticker.Locator`
290+
and also all the other Locators derived from this superclass.
296291

297292

298293
No `ValueError` for the MicrosecondLocator and YearLocator
@@ -309,15 +304,17 @@ the Date Locators.
309304

310305
The call signature was `OffsetBox.DrawingArea(..., clip=True)` but nothing
311306
was done with the `clip` argument. The object did not do any clipping
312-
regardless of that parameter. Now the object can and does clip the child `Artists` if they are set to be clipped.
307+
regardless of that parameter. Now the object can and does clip the
308+
child `Artists` if they are set to be clipped.
313309

314-
You can turn off the clipping on a per-child basis using `child.set_clip_on(False)`.
310+
You can turn off the clipping on a per-child basis using
311+
`child.set_clip_on(False)`.
315312

316313
Add salt to clipPath id
317314
~~~~~~~~~~~~~~~~~~~~~~~
318315

319316
Add salt to the hash used to determine the id of the ``clipPath``
320-
nodes. This is to avoid conflicts in two svg documents with the same
317+
nodes. This is to avoid conflicts when two svg documents with the same
321318
clip path are included in the same document (see
322319
https://github.com/ipython/ipython/issues/8133 and
323320
https://github.com/matplotlib/matplotlib/issues/4349 ), however this
@@ -428,7 +425,7 @@ Bundled jquery
428425

429426
The version of jquery bundled with the webagg backend has been upgraded
430427
from 1.7.1 to 1.11.3. If you are using the version of jquery bundled
431-
with webagg you will need to update you html files as such
428+
with webagg you will need to update your html files as such
432429

433430
.. code-block:: diff
434431
@@ -442,8 +439,9 @@ Code Removed
442439
Removed `Image` from main namespace
443440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444441

445-
`Image` was imported from PIL/pillow to test if PIL is available, but there is no
446-
reason to keep `Image` in the namespace once the availability has been determined.
442+
`Image` was imported from PIL/pillow to test if PIL is available, but
443+
there is no reason to keep `Image` in the namespace once the availability
444+
has been determined.
447445

448446
Removed `lod` from Artist
449447
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -484,7 +482,8 @@ Axis
484482
~~~~
485483
Removed method ``set_scale``. This is now handled via a private method which
486484
should not be used directly by users. It is called via ``Axes.set_{x,y}scale``
487-
which takes care of ensuring the coupled changes are also made to the Axes object.
485+
which takes care of ensuring the related changes are also made to the Axes
486+
object.
488487

489488
finance.py
490489
~~~~~~~~~~
@@ -501,11 +500,12 @@ Removed ``textcoords`` and ``xytext`` proprieties from Annotation objects.
501500
spinxext.ipython_*.py
502501
~~~~~~~~~~~~~~~~~~~~~
503502

504-
Both ``ipython_console_highlighting`` and ``ipython_directive`` have been moved to
505-
`IPython`.
503+
Both ``ipython_console_highlighting`` and ``ipython_directive`` have been
504+
moved to `IPython`.
506505

507506
Change your import from 'matplotlib.sphinxext.ipython_directive' to
508-
'IPython.sphinxext.ipython_directive' and from 'matplotlib.sphinxext.ipython_directive' to
507+
'IPython.sphinxext.ipython_directive' and from
508+
'matplotlib.sphinxext.ipython_directive' to
509509
'IPython.sphinxext.ipython_directive'
510510

511511

0 commit comments

Comments
 (0)