Skip to content

Commit c3d2eaf

Browse files
authored
Merge pull request matplotlib#24850 from dstansby/polar-affine-doc
Improve PolarAffine docstring
2 parents 087ca0c + 22b1c70 commit c3d2eaf

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

lib/matplotlib/projections/polar.py

+21-6
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,30 @@ def inverted(self):
115115

116116

117117
class PolarAffine(mtransforms.Affine2DBase):
118-
"""
119-
The affine part of the polar projection. Scales the output so
120-
that maximum radius rests on the edge of the axes circle.
118+
r"""
119+
The affine part of the polar projection.
120+
121+
Scales the output so that maximum radius rests on the edge of the axes
122+
circle and the origin is mapped to (0.5, 0.5). The transform applied is
123+
the same to x and y components and given by:
124+
125+
.. math::
126+
127+
x_{1} = 0.5 \left [ \frac{x_{0}}{(r_{\max} - r_{\min})} + 1 \right ]
128+
129+
:math:`r_{\min}, r_{\max}` are the minimum and maximum radial limits after
130+
any scaling (e.g. log scaling) has been removed.
121131
"""
122132
def __init__(self, scale_transform, limits):
123133
"""
124-
*limits* is the view limit of the data. The only part of
125-
its bounds that is used is the y limits (for the radius limits).
126-
The theta range is handled by the non-affine transform.
134+
Parameters
135+
----------
136+
scale_transform : `~matplotlib.transforms.Transform`
137+
Scaling transform for the data. This is used to remove any scaling
138+
from the radial view limits.
139+
limits : `~matplotlib.transforms.BboxBase`
140+
View limits of the data. The only part of its bounds that is used
141+
is the y limits (for the radius limits).
127142
"""
128143
super().__init__()
129144
self._scale_transform = scale_transform

0 commit comments

Comments
 (0)