Skip to content

Commit 1086ae8

Browse files
committed
Deprecate in InvertedPolarTransform
1 parent ec3dad6 commit 1086ae8

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",
@@ -219,6 +223,8 @@ def __init__(self, axis=None, use_rmin=True,
219223
self._axis = axis
220224
self._use_rmin = use_rmin
221225
self._apply_theta_transforms = _apply_theta_transforms
226+
if _apply_theta_transforms:
227+
_apply_theta_transforms_warn()
222228

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy