Skip to content

Commit 983dc8e

Browse files
committed
Restore PolarTransform(apply_theta_transforms) parameter
This partially reverts commit 6083ecd, but with a full deprecation of the parameter as a whole. Fixes matplotlib#31624
1 parent c4c0ac5 commit 983dc8e

4 files changed

Lines changed: 19 additions & 12 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
``apply_theta_transforms`` option in ``PolarTransform``
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Applying theta transforms in `~matplotlib.projections.polar.PolarTransform` and
5+
`~matplotlib.projections.polar.InvertedPolarTransform` has been removed, and the
6+
*apply_theta_transforms* keyword argument is deprecated for both classes.
7+
8+
If you need to retain the behaviour where theta values are transformed, chain the
9+
``PolarTransform`` with a `~matplotlib.transforms.Affine2D` transform that performs the
10+
theta shift and/or sign shift.

doc/api/next_api_changes/removals/30004-DS.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

lib/matplotlib/projections/polar.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class PolarTransform(mtransforms.Transform):
3434

3535
input_dims = output_dims = 2
3636

37-
def __init__(self, axis=None, use_rmin=True, *, scale_transform=None):
37+
@_api.delete_parameter('3.11', 'apply_theta_transforms')
38+
def __init__(self, axis=None, use_rmin=True, *,
39+
apply_theta_transforms=False, scale_transform=None):
3840
"""
3941
Parameters
4042
----------
@@ -183,7 +185,9 @@ class InvertedPolarTransform(mtransforms.Transform):
183185
"""
184186
input_dims = output_dims = 2
185187

186-
def __init__(self, axis=None, use_rmin=True):
188+
@_api.delete_parameter('3.11', 'apply_theta_transforms')
189+
def __init__(self, axis=None, use_rmin=True,
190+
*, apply_theta_transforms=False):
187191
"""
188192
Parameters
189193
----------

lib/matplotlib/projections/polar.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class PolarTransform(mtransforms.Transform):
1818
axis: PolarAxes | None = ...,
1919
use_rmin: bool = ...,
2020
*,
21+
apply_theta_transforms: bool = ...,
2122
scale_transform: mtransforms.Transform | None = ...,
2223
) -> None: ...
2324
def inverted(self) -> InvertedPolarTransform: ...
@@ -34,6 +35,8 @@ class InvertedPolarTransform(mtransforms.Transform):
3435
self,
3536
axis: PolarAxes | None = ...,
3637
use_rmin: bool = ...,
38+
*,
39+
apply_theta_transforms: bool = ...,
3740
) -> None: ...
3841
def inverted(self) -> PolarTransform: ...
3942

0 commit comments

Comments
 (0)