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

Skip to content

Commit c9bd855

Browse files
authored
Merge pull request #24984 from oscargus/pickradius
Expire deprecations from 3.6
2 parents b51a227 + c2b3f1f commit c9bd855

Some content is hidden

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

46 files changed

+284
-1128
lines changed

doc/api/axes_api.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ Drawing
556556
Axes.draw
557557
Axes.draw_artist
558558
Axes.redraw_in_frame
559-
Axes.get_renderer_cache
560559

561560
Axes.get_rasterization_zorder
562561
Axes.set_rasterization_zorder

doc/api/axis_api.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ Rendering helpers
138138

139139
Axis.get_minpos
140140
Axis.get_tick_space
141-
Axis.get_ticklabel_extents
142141
Axis.get_tightbbox
143142

144143

@@ -179,7 +178,6 @@ XAxis Specific
179178
:nosignatures:
180179

181180
XAxis.axis_name
182-
XAxis.get_text_heights
183181
XAxis.get_ticks_position
184182
XAxis.set_ticks_position
185183
XAxis.set_label_position
@@ -195,7 +193,6 @@ YAxis Specific
195193
:nosignatures:
196194

197195
YAxis.axis_name
198-
YAxis.get_text_widths
199196
YAxis.get_ticks_position
200197
YAxis.set_offset_position
201198
YAxis.set_ticks_position
@@ -260,7 +257,6 @@ specify a matching series of labels. Calling ``set_ticks`` makes a
260257

261258
Tick.get_loc
262259
Tick.get_pad
263-
Tick.get_pad_pixels
264260
Tick.get_tick_padding
265261
Tick.get_tickdir
266262
Tick.get_view_interval
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
Parameters to ``plt.figure()`` and the ``Figure`` constructor
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
All parameters to `.pyplot.figure` and the `.Figure` constructor, other than
5+
*num*, *figsize*, and *dpi*, are now keyword-only.
6+
7+
``stem(..., use_line_collection=False)``
8+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9+
10+
... is no longer supported. This was a compatibility fallback to a
11+
former more inefficient representation of the stem lines.
12+
13+
Positional / keyword arguments
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
16+
Passing all but the very few first arguments positionally in the constructors
17+
of Artists is no longer possible. Most arguments are now keyword-only.
18+
19+
The *emit* and *auto* parameters of ``set_xlim``, ``set_ylim``,
20+
``set_zlim``, ``set_rlim`` are now keyword-only.
21+
22+
The *transOffset* parameter of `.Collection.set_offset_transform` and the
23+
various ``create_collection`` methods of legend handlers has been renamed to
24+
*offset_transform* (consistently with the property name).
25+
26+
``Axes.get_window_extent`` / ``Figure.get_window_extent`` accept only
27+
*renderer*. This aligns the API with the general `.Artist.get_window_extent`
28+
API. All other parameters were ignored anyway.
29+
30+
Methods to set parameters in ``LogLocator`` and ``LogFormatter*``
31+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32+
33+
In `~.LogFormatter` and derived subclasses, the methods ``base`` and
34+
``label_minor`` for setting the respective parameter are removed and
35+
replaced by ``set_base`` and ``set_label_minor``, respectively.
36+
37+
In `~.LogLocator`, the methods ``base`` and ``subs`` for setting the respective
38+
parameter are removed. Instead, use ``set_params(base=..., subs=...)``.
39+
40+
``Axes.get_renderer_cache``
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
42+
43+
The canvas now takes care of the renderer and whether to cache it or not,
44+
so the ``Axes.get_renderer_cache`` method is removed. The
45+
alternative is to call ``axes.figure.canvas.get_renderer()``.
46+
47+
Unused methods in ``Axis``, ``Tick``, ``XAxis``, and ``YAxis``
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49+
50+
``Tick.label`` is now removed. Use ``Tick.label1`` instead.
51+
52+
The following methods are no longer used and removed without a replacement:
53+
54+
- ``Axis.get_ticklabel_extents``
55+
- ``Tick.get_pad_pixels``
56+
- ``XAxis.get_text_heights``
57+
- ``YAxis.get_text_widths``
58+
59+
``mlab.stride_windows``
60+
~~~~~~~~~~~~~~~~~~~~~~~
61+
62+
... is removed. Use ``numpy.lib.stride_tricks.sliding_window_view`` instead.
63+
64+
``Axes3D``
65+
~~~~~~~~~~
66+
67+
The ``dist`` attribute has been privatized. Use the *zoom* keyword argument in
68+
`.Axes3D.set_box_aspect` instead.
69+
70+
The ``w_xaxis``, ``w_yaxis``, and ``w_zaxis`` attributes are now removed.
71+
Instead use ``xaxis``, ``yaxis``, and ``zaxis``.
72+
73+
3D Axis
74+
~~~~~~~
75+
76+
``mplot3d.axis3d.Axis.set_pane_pos`` is removed. This is an internal method
77+
where the provided values are overwritten during drawing. Hence, it does not
78+
serve any purpose to be directly accessible.
79+
80+
The two helper functions ``mplot3d.axis3d.move_from_center`` and
81+
``mplot3d.axis3d.tick_update_position`` are considered internal and deprecated.
82+
If these are required, please vendor the code from the corresponding private
83+
methods ``_move_from_center`` and ``_tick_update_position``.
84+
85+
``checkdep_usetex`` removed
86+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
87+
88+
This method was only intended to disable tests in case no latex install was
89+
found. As such, it is considered to be private and for internal use only.
90+
91+
Please vendor the code from a previous version if you need this.
92+
93+
``date_ticker_factory`` removed
94+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95+
96+
The ``date_ticker_factory`` method in the `matplotlib.dates` module is
97+
removed. Instead use `~.AutoDateLocator` and `~.AutoDateFormatter` for a
98+
more flexible and scalable locator and formatter.
99+
100+
If you need the exact ``date_ticker_factory`` behavior, please copy the code
101+
from a previous version.
102+
103+
``transforms.Affine2D.identity()``
104+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
106+
... is removed in favor of directly calling the `.Affine2D` constructor with
107+
no arguments.
108+
109+
Removals in ``testing.decorators``
110+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111+
112+
The unused class ``CleanupTestCase`` and decorator ``cleanup`` are removed.
113+
The function ``check_freetype_version`` is considered internal and removed.
114+
Vendor the code from a previous version.
115+
116+
``text.get_rotation()``
117+
~~~~~~~~~~~~~~~~~~~~~~~
118+
119+
... is removed with no replacement. Copy the previous implementation if
120+
needed.
121+
122+
Miscellaneous internals
123+
~~~~~~~~~~~~~~~~~~~~~~~
124+
125+
- ``axes_grid1.axes_size.AddList``; use ``sum(sizes, start=Fixed(0))`` (for
126+
example) to sum multiple size objects.
127+
- ``axes_size.Padded``; use ``size + pad`` instead
128+
- ``axes_size.SizeFromFunc``, ``axes_size.GetExtentHelper``
129+
- ``AxisArtistHelper.delta1`` and ``AxisArtistHelper.delta2``
130+
- ``axislines.GridHelperBase.new_gridlines`` and
131+
``axislines.Axes.new_gridlines``
132+
- ``_DummyAxis.dataLim`` and ``_DummyAxis.viewLim``; use
133+
``get_data_interval()``, ``set_data_interval()``, ``get_view_interval()``,
134+
and ``set_view_interval()`` instead.
135+
- ``ImageMagickBase.delay`` and ``ImageMagickBase.output_args``
136+
- ``MathtextBackend``, ``MathtextBackendAgg``, ``MathtextBackendPath``,
137+
``MathTextWarning``
138+
- ``TexManager.get_font_config``; it previously returned an internal hashed key
139+
for used for caching purposes.
140+
- ``TextToPath.get_texmanager``; directly construct a `.texmanager.TexManager`
141+
instead.
142+
- ``ticker.is_close_to_int``; use ``math.isclose(x, round(x))`` instead.
143+
- ``ticker.is_decade``; use ``y = numpy.log(x)/numpy.log(base);
144+
numpy.isclose(y, numpy.round(y))`` instead.
145+
146+
147+
Backend-specific removals
148+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149+
150+
- ``backend_pdf.Name.hexify``
151+
- ``backend_pdf.Operator`` and ``backend_pdf.Op.op`` are removed in favor of
152+
a single standard `enum.Enum` interface on `.backend_pdf.Op`.
153+
- ``backend_pdf.fill``; vendor the code of the similarly named private
154+
functions if you rely on these functions.
155+
- ``backend_pgf.LatexManager.texcommand`` and
156+
``backend_pgf.LatexManager.latex_header``
157+
- ``backend_pgf.NO_ESCAPE``
158+
- ``backend_pgf.common_texification``
159+
- ``backend_pgf.get_fontspec``
160+
- ``backend_pgf.get_preamble``
161+
- ``backend_pgf.re_mathsep``
162+
- ``backend_pgf.writeln``
163+
- ``backend_ps.convert_psfrags``
164+
- ``backend_ps.quote_ps_string``; vendor the code of the similarly named
165+
private functions if you rely on it.
166+
- ``backend_svg.escape_attrib``; vendor the code of the similarly named private
167+
functions if you rely on it.
168+
- ``backend_svg.escape_cdata``; vendor the code of the similarly named private
169+
functions if you rely on it.
170+
- ``backend_svg.escape_comment``; vendor the code of the similarly named
171+
private functions if you rely on it.
172+
- ``backend_svg.short_float_fmt``; vendor the code of the similarly named
173+
private functions if you rely on it.
174+
- ``backend_svg.generate_transform`` and ``backend_svg.generate_css``

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ instead of ``\usepackage{ucs}\usepackage[utf8x]{inputenc}``.
463463

464464
Exception changes
465465
-----------------
466-
- `mpl_toolkits.axes_grid1.axes_size.GetExtentHelper` now raises `ValueError`
466+
- ``mpl_toolkits.axes_grid1.axes_size.GetExtentHelper`` now raises `ValueError`
467467
for invalid directions instead of `KeyError`.
468468
- Previously, subprocess failures in the animation framework would raise either
469469
in a `RuntimeError` or a `ValueError` depending on when the error occurred.
@@ -932,9 +932,9 @@ internal datetime representation; or use ``dates.datestr2num``.
932932
Axes3D
933933
~~~~~~
934934

935-
- `.axes3d.Axes3D.w_xaxis`
936-
- `.axes3d.Axes3D.w_yaxis`
937-
- `.axes3d.Axes3D.w_zaxis`
935+
- ``.axes3d.Axes3D.w_xaxis``
936+
- ``.axes3d.Axes3D.w_yaxis``
937+
- ``.axes3d.Axes3D.w_zaxis``
938938

939939
Use ``axes3d.Axes3D.xaxis``, ``axes3d.Axes3D.yaxis`` and
940940
``axes3d.Axes3D.zaxis`` instead.

doc/api/prev_api_changes/api_changes_3.6.0/removals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ The following module-level classes/variables have been removed:
9494
``mathtext.latex_to_standard``
9595
- ``mathtext.MathtextBackendPdf``, ``mathtext.MathtextBackendPs``,
9696
``mathtext.MathtextBackendSvg``, ``mathtext.MathtextBackendCairo``; use
97-
`.MathtextBackendPath` instead.
97+
``.MathtextBackendPath`` instead.
9898
- ``mathtext.Node`` and all its subclasses
9999
- ``mathtext.NUM_SIZE_LEVELS``
100100
- ``mathtext.Parser``

doc/api/toolkits/mplot3d/axes3d.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,6 @@ Aliases and deprecated methods
270270
tunit_cube
271271
tunit_edges
272272
unit_cube
273-
w_xaxis
274-
w_yaxis
275-
w_zaxis
276273

277274

278275
Other

doc/users/prev_whats_new/dflt_style_changes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ default. The default face color is now ``'C0'`` instead of ``'b'``.
575575
ax_bottom.set_ylim(0, .75)
576576
ax_bottom.add_artist(mpatches.Rectangle(grid[1] - [0.025, 0.05],
577577
0.05, 0.1))
578-
ax_bottom.add_artist(mpatches.RegularPolygon(grid[3], 5, 0.1))
578+
ax_bottom.add_artist(mpatches.RegularPolygon(grid[3], 5, radius=0.1))
579579
ax_bottom.add_artist(mpatches.Ellipse(grid[4], 0.2, 0.1))
580580
ax_bottom.add_artist(mpatches.Circle(grid[0], 0.1))
581581
ax_bottom.axis('off')

doc/users/prev_whats_new/whats_new_1.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Support for strides in mlab
121121
Todd Jennings added some functions to mlab to make it easier to use NumPy
122122
strides to create memory-efficient 2D arrays. This includes
123123
``matplotlib.mlab.stride_repeat``, which repeats an array to create a 2D
124-
array, and :func:`~matplotlib.mlab.stride_windows`, which uses a moving window
124+
array, and ``matplotlib.mlab.stride_windows``, which uses a moving window
125125
to create a 2D array from a 1D array.
126126

127127
Formatter for new-style formatting strings

lib/matplotlib/__init__.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -462,26 +462,6 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
462462
raise ValueError(f"Unknown executable: {name!r}")
463463

464464

465-
@_api.deprecated("3.6", alternative="a vendored copy of this function")
466-
def checkdep_usetex(s):
467-
if not s:
468-
return False
469-
if not shutil.which("tex"):
470-
_log.warning("usetex mode requires TeX.")
471-
return False
472-
try:
473-
_get_executable_info("dvipng")
474-
except ExecutableNotFoundError:
475-
_log.warning("usetex mode requires dvipng.")
476-
return False
477-
try:
478-
_get_executable_info("gs")
479-
except ExecutableNotFoundError:
480-
_log.warning("usetex mode requires ghostscript.")
481-
return False
482-
return True
483-
484-
485465
def _get_xdg_config_dir():
486466
"""
487467
Return the XDG configuration directory, according to the XDG base

lib/matplotlib/_mathtext.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
pyparsing_common)
2121

2222
import matplotlib as mpl
23-
from . import _api, cbook
23+
from . import cbook
2424
from ._mathtext_data import (
2525
latex_to_bakoma, stix_glyph_fixes, stix_virtual_fonts, tex2uni)
2626
from .font_manager import FontProperties, findfont, get_font
@@ -35,8 +35,7 @@
3535
# FONTS
3636

3737

38-
@_api.delete_parameter("3.6", "math")
39-
def get_unicode_index(symbol, math=False): # Publicly exported.
38+
def get_unicode_index(symbol): # Publicly exported.
4039
r"""
4140
Return the integer index (from the Unicode table) of *symbol*.
4241
@@ -45,17 +44,7 @@ def get_unicode_index(symbol, math=False): # Publicly exported.
4544
symbol : str
4645
A single (Unicode) character, a TeX command (e.g. r'\pi') or a Type1
4746
symbol name (e.g. 'phi').
48-
math : bool, default: False
49-
If True (deprecated), replace ASCII hyphen-minus by Unicode minus.
5047
"""
51-
# From UTF #25: U+2212 minus sign is the preferred
52-
# representation of the unary and binary minus sign rather than
53-
# the ASCII-derived U+002D hyphen-minus, because minus sign is
54-
# unambiguous and because it is rendered with a more desirable
55-
# length, usually longer than a hyphen.
56-
# Remove this block when the 'math' parameter is deleted.
57-
if math and symbol == '-':
58-
return 0x2212
5948
try: # This will succeed if symbol is a single Unicode char
6049
return ord(symbol)
6150
except TypeError:

lib/matplotlib/animation.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -615,18 +615,6 @@ class ImageMagickBase:
615615
_exec_key = 'animation.convert_path'
616616
_args_key = 'animation.convert_args'
617617

618-
@_api.deprecated("3.6")
619-
@property
620-
def delay(self):
621-
return 100. / self.fps
622-
623-
@_api.deprecated("3.6")
624-
@property
625-
def output_args(self):
626-
extra_args = (self.extra_args if self.extra_args is not None
627-
else mpl.rcParams[self._args_key])
628-
return [*extra_args, self.outfile]
629-
630618
def _args(self):
631619
# ImageMagick does not recognize "raw".
632620
fmt = "rgba" if self.frame_format == "raw" else self.frame_format

0 commit comments

Comments
 (0)