|
15 | 15 | from matplotlib.spines import Spine
|
16 | 16 |
|
17 | 17 |
|
| 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 | + |
18 | 31 | class PolarTransform(mtransforms.Transform):
|
19 | 32 | r"""
|
20 | 33 | The base polar transform.
|
@@ -53,16 +66,7 @@ def __init__(self, axis=None, use_rmin=True,
|
53 | 66 | self._apply_theta_transforms = _apply_theta_transforms
|
54 | 67 | self._scale_transform = scale_transform
|
55 | 68 | 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() |
66 | 70 |
|
67 | 71 | __str__ = mtransforms._make_str_method(
|
68 | 72 | "_axis",
|
@@ -219,6 +223,8 @@ def __init__(self, axis=None, use_rmin=True,
|
219 | 223 | self._axis = axis
|
220 | 224 | self._use_rmin = use_rmin
|
221 | 225 | self._apply_theta_transforms = _apply_theta_transforms
|
| 226 | + if _apply_theta_transforms: |
| 227 | + _apply_theta_transforms_warn() |
222 | 228 |
|
223 | 229 | __str__ = mtransforms._make_str_method(
|
224 | 230 | "_axis",
|
|
0 commit comments