11import math
2+ import warnings
23
34import numpy as npy
45
@@ -32,15 +33,6 @@ class PolarTransform(Transform):
3233 output_dims = 2
3334 is_separable = False
3435
35- def __init__ (self , resolution ):
36- """
37- Create a new polar transform. Resolution is the number of steps
38- to interpolate between each input line segment to approximate its
39- path in curved polar space.
40- """
41- Transform .__init__ (self )
42- self ._resolution = resolution
43-
4436 def transform (self , tr ):
4537 xy = npy .zeros (tr .shape , npy .float_ )
4638 t = tr [:, 0 :1 ]
@@ -59,15 +51,15 @@ def transform_path(self, path):
5951 vertices = path .vertices
6052 if len (vertices ) == 2 and vertices [0 , 0 ] == vertices [1 , 0 ]:
6153 return Path (self .transform (vertices ), path .codes )
62- ipath = path .interpolated (self . _resolution )
54+ ipath = path .interpolated (path . _interpolation_steps )
6355 return Path (self .transform (ipath .vertices ), ipath .codes )
6456 transform_path .__doc__ = Transform .transform_path .__doc__
6557
6658 transform_path_non_affine = transform_path
6759 transform_path_non_affine .__doc__ = Transform .transform_path_non_affine .__doc__
6860
6961 def inverted (self ):
70- return PolarAxes .InvertedPolarTransform (self . _resolution )
62+ return PolarAxes .InvertedPolarTransform ()
7163 inverted .__doc__ = Transform .inverted .__doc__
7264
7365 class PolarAffine (Affine2DBase ):
@@ -109,10 +101,6 @@ class InvertedPolarTransform(Transform):
109101 output_dims = 2
110102 is_separable = False
111103
112- def __init__ (self , resolution ):
113- Transform .__init__ (self )
114- self ._resolution = resolution
115-
116104 def transform (self , xy ):
117105 x = xy [:, 0 :1 ]
118106 y = xy [:, 1 :]
@@ -123,7 +111,7 @@ def transform(self, xy):
123111 transform .__doc__ = Transform .transform .__doc__
124112
125113 def inverted (self ):
126- return PolarAxes .PolarTransform (self . _resolution )
114+ return PolarAxes .PolarTransform ()
127115 inverted .__doc__ = Transform .inverted .__doc__
128116
129117 class ThetaFormatter (Formatter ):
@@ -177,8 +165,6 @@ def view_limits(self, vmin, vmax):
177165 return 0 , vmax
178166
179167
180- RESOLUTION = 1
181-
182168 def __init__ (self , * args , ** kwargs ):
183169 """
184170 Create a new Polar Axes for a polar plot.
@@ -192,8 +178,11 @@ def __init__(self, *args, **kwargs):
192178
193179 self ._rpad = 0.05
194180 self .resolution = kwargs .pop ('resolution' , None )
195- if self .resolution is None :
196- self .resolution = self .RESOLUTION
181+ if self .resolution not in (None , 1 ):
182+ warnings .warn (
183+ """The resolution kwarg to Polar plots is now ignored.
184+ If you need to interpolate data points, consider running
185+ cbook.simple_linear_interpolation on the data before passing to matplotlib.""" )
197186 Axes .__init__ (self , * args , ** kwargs )
198187 self .set_aspect ('equal' , adjustable = 'box' , anchor = 'C' )
199188 self .cla ()
@@ -221,7 +210,7 @@ def _set_lim_and_transforms(self):
221210 self .transScale = TransformWrapper (IdentityTransform ())
222211
223212 # A (possibly non-linear) projection on the (already scaled) data
224- self .transProjection = self .PolarTransform (self . resolution )
213+ self .transProjection = self .PolarTransform ()
225214
226215 # An affine transformation on the data, generally to limit the
227216 # range of the axes
0 commit comments