4
4
=============
5
5
6
6
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.
10
9
11
10
For new features that were added to matplotlib, please see
12
11
:ref: `whats-new `.
@@ -20,30 +19,26 @@ Deprecation and removal
20
19
21
20
Color of Axes
22
21
~~~~~~~~~~~~~
23
-
24
22
The ``axisbg `` and ``axis_bgcolor `` properties on ``Axes `` have been
25
23
deprecated in favor of ``facecolor ``.
26
24
27
25
28
26
GTK and GDK backends deprecated
29
27
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
35
33
36
34
WX backend deprecated
37
35
~~~~~~~~~~~~~~~~~~~~~
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.
43
39
44
40
CocoaAgg backend removed
45
41
~~~~~~~~~~~~~~~~~~~~~~~~
46
-
47
42
The deprecated and not fully functional CocoaAgg backend has been removed.
48
43
49
44
@@ -56,16 +51,15 @@ now use a common codepath to look up how to update the given artist
56
51
properties (either using the setter methods or an attribute/property).
57
52
58
53
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
60
55
changing the API of `matplotlib.Artist.set ` and
61
56
`matplotlib.artist.setp `.
62
57
63
58
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
65
60
`matplotlib.Artist.set ` and `matplotlib.artist.setp `. This should not
66
61
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.
69
63
70
64
71
65
`Legend ` initializers gain edgecolor and facecolor kwargs
@@ -108,18 +102,19 @@ See the ``draw_image`` docstring for more information.
108
102
`matplotlib.ticker.LinearLocator ` algorithm update
109
103
--------------------------------------------------
110
104
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.
115
110
116
111
The view range algorithm in ``matplotlib.ticker.LinearLocator `` has been
117
112
changed so that more convenient tick locations are chosen. The new algorithm
118
113
returns a plot view range that is a multiple of the user-requested number of
119
114
ticks. This ensures tick marks will be located at whole integers more
120
115
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 .
123
118
124
119
125
120
New defaults for 3D quiver function in mpl_toolkits.mplot3d.axes3d.py
@@ -175,34 +170,34 @@ Changes in 1.5.0
175
170
Code Changes
176
171
------------
177
172
178
- Split `matplotlib.cbook.ls_mapper ` in two
179
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173
+ Reversed `matplotlib.cbook.ls_mapper `, added ` ls_mapper_r `
174
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180
175
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 ` .
186
181
187
182
Prevent moving artists between Axes, Property-ify Artist.axes, deprecate Artist.{get,set}_axes
188
183
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189
184
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.
192
187
This was never supported as it causes havoc with the transform stack.
193
188
The apparent support for this (as it did not raise an exception) was
194
189
the source of multiple bug reports and questions on SO.
195
190
196
191
For almost all use-cases, the assignment of the axes to an artist should be
197
192
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.
199
194
200
195
Removing the ``set_axes `` method will also remove the 'axes' line from
201
196
the ACCEPTS kwarg tables (assuming that the removal date gets here
202
197
before that gets overhauled).
203
198
204
- Tighted input validation on 'pivot' kwarg to quiver
205
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
199
+ Tightened input validation on 'pivot' kwarg to quiver
200
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206
201
207
202
Tightened validation so that only {'tip', 'tail', 'mid', and 'middle'}
208
203
(but any capitalization) are valid values for the 'pivot' kwarg in
@@ -253,20 +248,20 @@ Added set_params function to all Locator types
253
248
This was a bug fix targeted at making the api for Locators more consistent.
254
249
255
250
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 *(
257
252
aside: set_params(args) is a function that sets the parameters of a Locator
258
253
instance to be as specified within args) *. The fix involves moving set_params()
259
254
to the Locator class such that all subtypes will have this function defined.
260
255
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
262
257
universal set_params() in Locator isn't ideal. Instead, a default no-operation
263
258
function that raises a warning is implemented in Locator. Subtypes extending
264
259
Locator will then override with their own implementations. Subtypes that do
265
260
not have a need for set_params() will fall back onto their parent's
266
261
implementation, which raises a warning as intended.
267
262
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(),
270
265
the default implementation in Locator is used.
271
266
272
267
Disallow ``None `` as x or y value in ax.plot
@@ -291,8 +286,8 @@ Removed `args` and `kwargs` from `MicrosecondLocator.__call__`
291
286
292
287
The call signature of :meth: `~matplotlib.dates.MicrosecondLocator.__call__ `
293
288
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 .
296
291
297
292
298
293
No `ValueError ` for the MicrosecondLocator and YearLocator
@@ -309,15 +304,17 @@ the Date Locators.
309
304
310
305
The call signature was `OffsetBox.DrawingArea(..., clip=True) ` but nothing
311
306
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.
313
309
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) `.
315
312
316
313
Add salt to clipPath id
317
314
~~~~~~~~~~~~~~~~~~~~~~~
318
315
319
316
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
321
318
clip path are included in the same document (see
322
319
https://github.com/ipython/ipython/issues/8133 and
323
320
https://github.com/matplotlib/matplotlib/issues/4349 ), however this
@@ -428,7 +425,7 @@ Bundled jquery
428
425
429
426
The version of jquery bundled with the webagg backend has been upgraded
430
427
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
432
429
433
430
.. code-block :: diff
434
431
@@ -442,8 +439,9 @@ Code Removed
442
439
Removed `Image ` from main namespace
443
440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444
441
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.
447
445
448
446
Removed `lod ` from Artist
449
447
~~~~~~~~~~~~~~~~~~~~~~~~~
484
482
~~~~
485
483
Removed method ``set_scale ``. This is now handled via a private method which
486
484
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.
488
487
489
488
finance.py
490
489
~~~~~~~~~~
@@ -501,11 +500,12 @@ Removed ``textcoords`` and ``xytext`` proprieties from Annotation objects.
501
500
spinxext.ipython_*.py
502
501
~~~~~~~~~~~~~~~~~~~~~
503
502
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 `.
506
505
507
506
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
509
509
'IPython.sphinxext.ipython_directive'
510
510
511
511
0 commit comments