1
1
API Changes for 3.1.0
2
2
=====================
3
3
4
+ .. contents ::
5
+ :local:
6
+ :depth: 1
7
+
8
+
9
+ ``pgi `` support dropped
10
+ -----------------------
11
+ Support for ``pgi `` in the GTK3 backends has been dropped.
12
+ ``pgi `` is an alternative implementation to PyGObject, which
13
+ should be used instead.
14
+
15
+ rcparams
16
+ --------
17
+
18
+ Removed
19
+ ~~~~~~~
20
+ The following deprecated rcParams have been removed:
21
+
22
+ - ``text.dvipnghack ``,
23
+ - ``nbagg.transparent `` (use :rc: `figure.facecolor ` instead),
24
+ - ``plugins.directory ``,
25
+ - ``axes.hold ``,
26
+ - ``backend.qt4 `` and ``backend.qt5 `` (set the :envvar: `QT_API ` environment
27
+ variable instead).
28
+
29
+ Deprecated
30
+ ~~~~~~~~~~
31
+ The associated validator functions ``rcsetup.validate_qt4 `` and
32
+ ``validate_qt5 `` are deprecated.
33
+
4
34
Behavior changes
5
35
----------------
6
36
@@ -128,12 +158,72 @@ use one character of the string for each flow.
128
158
The behavior has been changed to match the documented one: when a single string
129
159
is passed, it is used to label all the flows.
130
160
161
+ FontManager scores
162
+ ~~~~~~~~~~~~~~~~~~
163
+ `FontManager.score_weight ` is now more strict with its inputs.
164
+ Previously, when a weight string was passed to `FontManager.score_weight `,
165
+
166
+ - if the weight was the string representation of an integer, it would be
167
+ converted to that integer,
168
+ - otherwise, if the weight was not a standard weight name, it would be silently
169
+ replaced by a value of 500 ("normal" weight).
170
+
171
+ `FontManager.score_weight ` now raises an exception on such inputs.
172
+
173
+ Text alignment
174
+ ~~~~~~~~~~~~~~
175
+ Text alignment was previously incorrect, in particular for multiline text
176
+ objects with large descenders (i.e. subscripts) and rotated text. These have
177
+ been fixed and made more consistent, but could make old code that has
178
+ compensated for this no longer have the correct alignment.
179
+
180
+ Upper case color strings
181
+ ~~~~~~~~~~~~~~~~~~~~~~~~
182
+
183
+ Support for passing single-letter colors (one of "rgbcmykw") as UPPERCASE
184
+ characters is deprecated; these colors will become case-sensitive (lowercase)
185
+ after the deprecation period has passed.
186
+
187
+ The goal is to decrease the number of ambiguous cases when using the ``data ``
188
+ keyword to plotting methods; e.g. ``plot("X", "Y", data={"X": ..., "Y": ...}) ``
189
+ will not warn about "Y" possibly being a color anymore after the deprecation
190
+ period has passed.
191
+
192
+ Degenerate limits
193
+ ~~~~~~~~~~~~~~~~~
194
+ When bounds passed to `set_xlim ` (`set_xlim `, etc.) are degenerate (i.e. the
195
+ lower and upper value are equal), the method used to "expand" the bounds now
196
+ matches the expansion behavior of autoscaling when the plot contains a single
197
+ x-value, and should in particular produce nicer limits for non-linear scales.
198
+
199
+ `~.Axes.plot ` format string parsing
200
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201
+ In certain cases, `~.Axes.plot ` would previously accept format strings
202
+ specifying more than one linestyle (e.g. ``"---." `` which specifies both
203
+ ``"--" `` and ``"-." ``); only use one of them would be used. This now raises a
204
+ `ValueError ` instead.
205
+
206
+ HTMLWriter
207
+ ~~~~~~~~~~
208
+ The HTMLWriter constructor is more strict: it no longer normalizes unknown
209
+ values of *default_mode * to 'loop', but errors out instead.
210
+
211
+ AFM parsing
212
+ ~~~~~~~~~~~
213
+ In accordance with the AFM spec, the AFM parser no longer truncates the
214
+ ``UnderlinePosition `` and ``UnderlineThickness `` fields to integers.
215
+
216
+ The ``Notice `` field (which can only be publicly accessed by the deprecated
217
+ ``afm.parse_afm `` API) is no longer decoded to a `str `, but instead kept as
218
+ `bytes `, to support non-conformant AFM files that use non-ASCII characters in
219
+ that field.
220
+
131
221
Exception changes
132
222
-----------------
133
-
134
223
- `mpl_toolkits.axes_grid1.axes_size.GetExtentHelper ` now raises `ValueError `
135
224
for invalid directions instead of `KeyError `.
136
225
226
+
137
227
Removals
138
228
--------
139
229
The following deprecated APIs have been removed:
@@ -170,17 +260,24 @@ Arguments
170
260
171
261
Other
172
262
~~~~~
173
- - svgfont support (in :rc: `svg.fonttype `) has been removed,
263
+ The following misc API elements have been removed:
264
+
265
+ - svgfont support (in :rc: `svg.fonttype `)
174
266
- Logging is now done with the standard python ``logging `` library.
175
- ``matplotlib.verbose `` and the command line switches ``--verbose-LEVEL `` are
176
- removed.
267
+ ``matplotlib.verbose `` and the command line switches ``--verbose-LEVEL `` have
268
+ been removed.
177
269
178
270
To control the logging output use::
179
271
180
272
import logging
181
273
logger = logging.getLogger('matplotlib')
182
274
logger.set_level(logging.INFO)
183
275
276
+ - ``collections.CIRCLE_AREA_FACTOR ``
277
+ - ``font_manager.USE_FONTCONFIG ``
278
+ - ``font_manager.cachedir ``
279
+ - ``__version__numpy__ ``
280
+
184
281
:mod: `matplotlib.mlab ` removals
185
282
-------------------------------
186
283
Lots of code inside the :mod: `matplotlib.mlab ` module which was deprecated
@@ -352,13 +449,11 @@ supported version of ghostscript is now 9.0 (released in 2010).
352
449
353
450
Mathtext changes
354
451
----------------
355
-
356
452
- In constructs such as ``"$1~2$" ``, mathtext now interprets the tilde as a
357
453
space, consistently with TeX (this was previously a parse error).
358
454
359
455
Deprecations
360
456
~~~~~~~~~~~~
361
-
362
457
- The ``\stackrel `` mathtext command hsa been deprecated (it behaved differently
363
458
from LaTeX's ``\stackrel ``. To stack two mathtext expressions, use
364
459
``\genfrac{left-delim}{right-delim}{fraction-bar-thickness}{}{top}{bottom} ``.
@@ -586,6 +681,12 @@ Manually check the lengths of the inputs instead, or rely on numpy to do it.
586
681
587
682
Use ``isinstance(..., collections.abc.Hashable) `` instead.
588
683
684
+ - ``bezier.find_r_to_boundary_of_closedpath `` function is deprecated
685
+
686
+ This has always returned None instead of the requested radius.
687
+
688
+ - The ``MATPLOTLIBDATA `` environment variable
689
+
589
690
Undeprecations
590
691
--------------
591
692
The following API elements have bee un-deprecated:
@@ -600,17 +701,6 @@ For consistency with `Line2D`, the `Text` class has gained the ``c``
600
701
alias for the ``color `` property. For example, one can now write
601
702
``ax.text(.5, .5, "foo", c="red") ``.
602
703
603
- Changes in AFM parsing
604
- ----------------------
605
-
606
- In accordance with the AFM spec, the AFM parser no longer truncates the
607
- ``UnderlinePosition `` and ``UnderlineThickness `` fields to integers.
608
-
609
- The ``Notice `` field (which can only be publicly accessed by the deprecated
610
- ``afm.parse_afm `` API) is no longer decoded to a `str `, but instead kept as
611
- `bytes `, to support non-conformant AFM files that use non-ASCII characters in
612
- that field.
613
-
614
704
Axes.tick_params argument checking
615
705
----------------------------------
616
706
@@ -706,15 +796,7 @@ API deprecations
706
796
----------------
707
797
708
798
The following environment variables are deprecated:
709
- - ``MATPLOTLIBDATA ``,
710
799
711
- Text alignment fixes made
712
- -------------------------
713
-
714
- Text alignment was incorrect, in particular for multiline text objects
715
- with large descenders (i.e. subscripts) and rotated text. These have been
716
- fixed and made more consistent, but could make old code that has compensated
717
- no longer have the correct alignment.
718
800
719
801
Path code types like ``Path.MOVETO `` are now ``np.uint8 `` instead of ``int ``
720
802
----------------------------------------------------------------------------
@@ -733,35 +815,15 @@ of Matplotlib, unicode input will always be supported).
733
815
Moreover, the underlying implementation now uses ``\usepackage[utf8]{inputenc} ``
734
816
instead of ``\usepackage{ucs}\usepackage[utf8x]{inputenc} ``.
735
817
736
- Changes in handling of degenerate bounds passed to `set_xlim `
737
- -------------------------------------------------------------
738
-
739
- When bounds passed to `set_xlim ` (`set_xlim `, etc.) are degenerate (i.e. the
740
- lower and upper value are equal), the method used to "expand" the bounds now
741
- matches the expansion behavior of autoscaling when the plot contains a single
742
- x-value, and should in particular produce nicer limits for non-linear scales.
743
-
744
818
Deprecations
745
819
------------
746
-
747
820
The following keyword arguments are deprecated:
748
821
749
822
- Passing ``shade=None `` to
750
823
`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface ` is deprecated. This was
751
824
an unintended implementation detail with the same semantics as
752
825
``shade=False ``. Please use the latter code instead.
753
826
754
- Deprecations
755
- ------------
756
-
757
- Support for passing single-letter colors (one of "rgbcmykw") as UPPERCASE
758
- characters is deprecated; these colors will become case-sensitive (lowercase)
759
- after the deprecation period has passed.
760
-
761
- The goal is to decrease the number of ambiguous cases when using the ``data ``
762
- keyword to plotting methods; e.g. ``plot("X", "Y", data={"X": ..., "Y": ...}) ``
763
- will not warn about "Y" possibly being a color anymore after the deprecation
764
- period has passed.
765
827
766
828
Allow "real" LaTeX code for ``pgf.preamble `` and ``text.latex.preamble `` in matplotlib rc file
767
829
----------------------------------------------------------------------------------------------
@@ -807,11 +869,6 @@ matplotlib.font_manager.win32InstalledFonts return value
807
869
`matplotlib.font_manager.win32InstalledFonts ` returns an empty list instead
808
870
of None if no fonts are found.
809
871
810
- The HTMLWriter constructor is more strict
811
- -----------------------------------------
812
-
813
- It no longer normalizes unknown values of *default_mode * to 'loop', but errors
814
- out instead.
815
872
816
873
New `Formatter.format_ticks ` method
817
874
-----------------------------------
@@ -866,18 +923,6 @@ values for each one of the lists. For example, an input of ``[[],[]]`` will
866
923
return 2 lists of histogram values. Previously, a single list was returned.
867
924
868
925
869
- `FontManager.score_weight ` is more strict with its inputs
870
- ---------------------------------------------------------
871
-
872
- Previously, when a weight string was passed to `FontManager.score_weight `,
873
-
874
- - if the weight was the string representation of an integer, it would be
875
- converted to that integer,
876
- - otherwise, if the weight was not a standard weight name, it would be silently
877
- replaced by a value of 500 ("normal" weight).
878
-
879
- `FontManager.score_weight ` now raises an exception on such inputs.
880
-
881
926
``Cn `` colors now support ``n>=10 ``
882
927
-----------------------------------
883
928
@@ -914,15 +959,9 @@ Matplotlib 3.3.
914
959
``filterrad ``, ``resample ``, and ``url `` arguments should be passed by
915
960
keyword.
916
961
917
- Deprecations
918
- ------------
919
-
920
- The ``bezier.find_r_to_boundary_of_closedpath `` function is deprecated (it has
921
- always returned None instead of the requested radius).
922
962
923
963
Poly3DCollection.set_zsort
924
964
--------------------------
925
-
926
965
`Poly3DCollection.set_zsort ` no longer silently ignores invalid inputs, or
927
966
False (which was always broken). Passing True to mean "average" is deprecated.
928
967
@@ -983,41 +1022,6 @@ In certain cases, Axes methods (and pyplot functions) used to raise a
983
1022
RuntimeError if they were called with a ``data `` kwarg and otherwise mismatched
984
1023
arguments. They now raise a ``TypeError `` instead.
985
1024
986
- Removed rcParams
987
- ----------------
988
-
989
- The following deprecated rcParams are removed:
990
-
991
- - ``text.dvipnghack ``,
992
- - ``nbagg.transparent `` (use :rc: `figure.facecolor ` instead),
993
- - ``plugins.directory ``,
994
- - ``axes.hold ``,
995
- - ``backend.qt4 `` and ``backend.qt5 `` (set the :envvar: `QT_API ` environment
996
- variable instead).
997
-
998
- The associated validator functions ``rcsetup.validate_qt4 `` and
999
- ``validate_qt5 `` are deprecated.
1000
-
1001
- Drop support for ``pgi `` in the GTK3 backends
1002
- ---------------------------------------------
1003
- ``pgi ``, an alternative implementation to PyGObject, is no longer supported in
1004
- the GTK3 backends. PyGObject should be used instead.
1005
-
1006
-
1007
- Removals
1008
- --------
1009
-
1010
- The ``collections.CIRCLE_AREA_FACTOR `` constant has been removed.
1011
-
1012
- Stricter `~.Axes.plot ` format string parsing
1013
- --------------------------------------------
1014
-
1015
- In certain cases, `~.Axes.plot ` would previously accept format strings
1016
- specifying more than one linestyle (e.g. ``"---." `` which specifies both
1017
- ``"--" `` and ``"-." ``); only use one of them would be used.
1018
-
1019
- This now raises a ValueError instead.
1020
-
1021
1025
API changes
1022
1026
-----------
1023
1027
0 commit comments