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

Skip to content

Commit 34209f3

Browse files
dstansbytacaswell
authored andcommitted
More moving around
1 parent 52a4d56 commit 34209f3

1 file changed

Lines changed: 107 additions & 103 deletions

File tree

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 107 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
API Changes for 3.1.0
22
=====================
33

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+
434
Behavior changes
535
----------------
636

@@ -128,12 +158,72 @@ use one character of the string for each flow.
128158
The behavior has been changed to match the documented one: when a single string
129159
is passed, it is used to label all the flows.
130160

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+
131221
Exception changes
132222
-----------------
133-
134223
- `mpl_toolkits.axes_grid1.axes_size.GetExtentHelper` now raises `ValueError`
135224
for invalid directions instead of `KeyError`.
136225

226+
137227
Removals
138228
--------
139229
The following deprecated APIs have been removed:
@@ -170,17 +260,24 @@ Arguments
170260

171261
Other
172262
~~~~~
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`)
174266
- 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.
177269

178270
To control the logging output use::
179271

180272
import logging
181273
logger = logging.getLogger('matplotlib')
182274
logger.set_level(logging.INFO)
183275

276+
- ``collections.CIRCLE_AREA_FACTOR``
277+
- ``font_manager.USE_FONTCONFIG``
278+
- ``font_manager.cachedir``
279+
- ``__version__numpy__``
280+
184281
:mod:`matplotlib.mlab` removals
185282
-------------------------------
186283
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).
352449

353450
Mathtext changes
354451
----------------
355-
356452
- In constructs such as ``"$1~2$"``, mathtext now interprets the tilde as a
357453
space, consistently with TeX (this was previously a parse error).
358454

359455
Deprecations
360456
~~~~~~~~~~~~
361-
362457
- The ``\stackrel`` mathtext command hsa been deprecated (it behaved differently
363458
from LaTeX's ``\stackrel``. To stack two mathtext expressions, use
364459
``\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.
586681

587682
Use ``isinstance(..., collections.abc.Hashable)`` instead.
588683

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+
589690
Undeprecations
590691
--------------
591692
The following API elements have bee un-deprecated:
@@ -600,17 +701,6 @@ For consistency with `Line2D`, the `Text` class has gained the ``c``
600701
alias for the ``color`` property. For example, one can now write
601702
``ax.text(.5, .5, "foo", c="red")``.
602703

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-
614704
Axes.tick_params argument checking
615705
----------------------------------
616706

@@ -706,15 +796,7 @@ API deprecations
706796
----------------
707797

708798
The following environment variables are deprecated:
709-
- ``MATPLOTLIBDATA``,
710799

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.
718800

719801
Path code types like ``Path.MOVETO`` are now ``np.uint8`` instead of ``int``
720802
----------------------------------------------------------------------------
@@ -733,35 +815,15 @@ of Matplotlib, unicode input will always be supported).
733815
Moreover, the underlying implementation now uses ``\usepackage[utf8]{inputenc}``
734816
instead of ``\usepackage{ucs}\usepackage[utf8x]{inputenc}``.
735817

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-
744818
Deprecations
745819
------------
746-
747820
The following keyword arguments are deprecated:
748821

749822
- Passing ``shade=None`` to
750823
`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface` is deprecated. This was
751824
an unintended implementation detail with the same semantics as
752825
``shade=False``. Please use the latter code instead.
753826

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.
765827

766828
Allow "real" LaTeX code for ``pgf.preamble`` and ``text.latex.preamble`` in matplotlib rc file
767829
----------------------------------------------------------------------------------------------
@@ -807,11 +869,6 @@ matplotlib.font_manager.win32InstalledFonts return value
807869
`matplotlib.font_manager.win32InstalledFonts` returns an empty list instead
808870
of None if no fonts are found.
809871

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.
815872

816873
New `Formatter.format_ticks` method
817874
-----------------------------------
@@ -866,18 +923,6 @@ values for each one of the lists. For example, an input of ``[[],[]]`` will
866923
return 2 lists of histogram values. Previously, a single list was returned.
867924

868925

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-
881926
``Cn`` colors now support ``n>=10``
882927
-----------------------------------
883928

@@ -914,15 +959,9 @@ Matplotlib 3.3.
914959
``filterrad``, ``resample``, and ``url`` arguments should be passed by
915960
keyword.
916961

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).
922962

923963
Poly3DCollection.set_zsort
924964
--------------------------
925-
926965
`Poly3DCollection.set_zsort` no longer silently ignores invalid inputs, or
927966
False (which was always broken). Passing True to mean "average" is deprecated.
928967

@@ -983,41 +1022,6 @@ In certain cases, Axes methods (and pyplot functions) used to raise a
9831022
RuntimeError if they were called with a ``data`` kwarg and otherwise mismatched
9841023
arguments. They now raise a ``TypeError`` instead.
9851024

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-
10211025
API changes
10221026
-----------
10231027

0 commit comments

Comments
 (0)