Skip to content

Commit 2c91f98

Browse files
committed
Deprecate in InvertedPolarTransform
1 parent b448209 commit 2c91f98

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Applying theta transforms in ``PolarTransform``
22
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
Applying theta transforms in `~matplotlib.projections.polar.PolarTransform`
4+
and `~matplotlib.projections.polar.InvertedPolarTransform`
45
is deprecated. This is currently the default behaviour, so to prevent
56
a warning, manually pass ``_apply_theta_transforms=False``, and
67
apply any theta shift before passing points to this transform.

lib/matplotlib/projections/polar.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515
from matplotlib.spines import Spine
1616

1717

18+
def _apply_theta_transforms_warn():
19+
_api.warn_deprecated(
20+
"3.7",
21+
message=(
22+
"Passing `_apply_theta_transforms=True` (the default) "
23+
"is deprecated. Support for this will be removed in "
24+
"Matplotlib %(removal)s. To prevent this warning, "
25+
"set `_apply_theta_transforms=False`, and make sure to "
26+
"shift theta values before being passed to this transform."
27+
)
28+
)
29+
30+
1831
class PolarTransform(mtransforms.Transform):
1932
r"""
2033
The base polar transform.
@@ -53,16 +66,7 @@ def __init__(self, axis=None, use_rmin=True,
5366
self._apply_theta_transforms = _apply_theta_transforms
5467
self._scale_transform = scale_transform
5568
if _apply_theta_transforms:
56-
_api.warn_deprecated(
57-
"3.7",
58-
message=(
59-
"Passing `_apply_theta_transforms=True` (the default) "
60-
"is deprecated. Support for this will be removed in "
61-
"Matplotlib %(removal)s. To prevent this warning, "
62-
"set `_apply_theta_transforms=False`, and make sure to "
63-
"shift theta values before being passed to this transform."
64-
)
65-
)
69+
_apply_theta_transforms_warn()
6670

6771
__str__ = mtransforms._make_str_method(
6872
"_axis",
@@ -220,6 +224,8 @@ def __init__(self, axis=None, use_rmin=True,
220224
self._axis = axis
221225
self._use_rmin = use_rmin
222226
self._apply_theta_transforms = _apply_theta_transforms
227+
if _apply_theta_transforms:
228+
_apply_theta_transforms_warn()
223229

224230
__str__ = mtransforms._make_str_method(
225231
"_axis",

0 commit comments

Comments
 (0)