Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6d7d585

Browse files
committed
Deprecated _apply_theta_transforms=True
Update changelogFix internal uses of PolarTransform
1 parente9d1f9c commit6d7d585

File tree

5 files changed

+22
-5
lines changed

5 files changed

+22
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Applying theta transfroms in ``PolarTransform``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Applying theta transforms in `~matplotlib.projections.polar.PolarTransform`
4+
is deprecated. This is currently the default behaviour, so to prevent
5+
a warning, manually pass ``_apply_theta_transforms=False``, and
6+
apply any theta shift before passing points to this transform.

‎lib/matplotlib/projections/polar.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ def __init__(self, axis=None, use_rmin=True,
3535
self._axis=axis
3636
self._use_rmin=use_rmin
3737
self._apply_theta_transforms=_apply_theta_transforms
38+
if_apply_theta_transforms:
39+
_api.warn_deprecated(
40+
"3.7",
41+
message=(
42+
"Passing `_apply_theta_transforms=True` (the default) "
43+
"is deprecated. Support for this will be removed in "
44+
"Matplotlib %(removal)s. To prevent this warning, "
45+
"set `_apply_theta_transforms=False`, and make sure to "
46+
"shift theta values before being passed to this transform."
47+
)
48+
)
3849

3950
__str__=mtransforms._make_str_method(
4051
"_axis",

‎lib/matplotlib/text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@ def _get_xy_transform(self, renderer, s):
15081508
returnself.axes.transData
15091509
elifs=='polar':
15101510
frommatplotlib.projectionsimportPolarAxes
1511-
tr=PolarAxes.PolarTransform()
1511+
tr=PolarAxes.PolarTransform(_apply_theta_transforms=False)
15121512
trans=tr+self.axes.transData
15131513
returntrans
15141514

‎lib/mpl_toolkits/axisartist/tests/test_floating_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_curvelinear3():
2424
fig=plt.figure(figsize=(5,5))
2525

2626
tr= (mtransforms.Affine2D().scale(np.pi/180,1)+
27-
mprojections.PolarAxes.PolarTransform())
27+
mprojections.PolarAxes.PolarTransform(_apply_theta_transforms=False))
2828
grid_helper=GridHelperCurveLinear(
2929
tr,
3030
extremes=(0,360,10,3),
@@ -73,7 +73,7 @@ def test_curvelinear4():
7373
fig=plt.figure(figsize=(5,5))
7474

7575
tr= (mtransforms.Affine2D().scale(np.pi/180,1)+
76-
mprojections.PolarAxes.PolarTransform())
76+
mprojections.PolarAxes.PolarTransform(_apply_theta_transforms=False))
7777
grid_helper=GridHelperCurveLinear(
7878
tr,
7979
extremes=(120,30,10,0),

‎lib/mpl_toolkits/axisartist/tests/test_grid_helper_curvelinear.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def test_polar_box():
8484

8585
# PolarAxes.PolarTransform takes radian. However, we want our coordinate
8686
# system in degree
87-
tr=Affine2D().scale(np.pi/180.,1.)+PolarAxes.PolarTransform()
87+
tr=Affine2D().scale(np.pi/180.,1.)+PolarAxes.PolarTransform(_apply_theta_transforms=False)
8888

8989
# polar projection, which involves cycle, and also has limits in
9090
# its coordinates, needs a special method to find the extremes
@@ -146,7 +146,7 @@ def test_axis_direction():
146146

147147
# PolarAxes.PolarTransform takes radian. However, we want our coordinate
148148
# system in degree
149-
tr=Affine2D().scale(np.pi/180.,1.)+PolarAxes.PolarTransform()
149+
tr=Affine2D().scale(np.pi/180.,1.)+PolarAxes.PolarTransform(_apply_theta_transforms=False)
150150

151151
# polar projection, which involves cycle, and also has limits in
152152
# its coordinates, needs a special method to find the extremes

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp