1414from matplotlib .ticker import Formatter , Locator , FormatStrFormatter
1515from matplotlib .transforms import Affine2D , Affine2DBase , Bbox , \
1616 BboxTransformTo , IdentityTransform , Transform , TransformWrapper , \
17- ScaledTranslation , blended_transform_factory
17+ ScaledTranslation , blended_transform_factory , BboxTransformToMaxOnly
1818import matplotlib .spines as mspines
1919
2020class PolarAxes (Axes ):
@@ -41,16 +41,16 @@ def __init__(self, axis=None):
4141 self ._axis = axis
4242
4343 def transform (self , tr ):
44- xy = np .zeros (tr .shape , np .float_ )
44+ xy = np .empty (tr .shape , np .float_ )
4545 if self ._axis is not None :
4646 rmin = self ._axis .viewLim .ymin
4747 else :
4848 rmin = 0
4949
50- t = tr [:, 0 :1 ]
51- r = tr [:, 1 :2 ]
52- x = xy [:, 0 :1 ]
53- y = xy [:, 1 :2 ]
50+ t = tr [:, 0 :1 ]
51+ r = tr [:, 1 :2 ]
52+ x = xy [:, 0 :1 ]
53+ y = xy [:, 1 :2 ]
5454
5555 if rmin != 0 :
5656 r = r - rmin
@@ -188,7 +188,7 @@ def refresh(self):
188188
189189 def view_limits (self , vmin , vmax ):
190190 vmin , vmax = self .base .view_limits (vmin , vmax )
191- return 0 , vmax
191+ return vmin , vmax
192192
193193
194194 def __init__ (self , * args , ** kwargs ):
@@ -290,15 +290,17 @@ def _set_lim_and_transforms(self):
290290 # The r-axis labels are put at an angle and padded in the r-direction
291291 self ._r_label1_position = ScaledTranslation (
292292 22.5 , self ._rpad ,
293- blended_transform_factory (Affine2D (), BboxTransformTo (self .viewLim )))
293+ blended_transform_factory (
294+ Affine2D (), BboxTransformToMaxOnly (self .viewLim )))
294295 self ._yaxis_text1_transform = (
295296 self ._r_label1_position +
296297 Affine2D ().scale (1.0 / 360.0 , 1.0 ) +
297298 self ._yaxis_transform
298299 )
299300 self ._r_label2_position = ScaledTranslation (
300301 22.5 , - self ._rpad ,
301- blended_transform_factory (Affine2D (), BboxTransformTo (self .viewLim )))
302+ blended_transform_factory (
303+ Affine2D (), BboxTransformToMaxOnly (self .viewLim )))
302304 self ._yaxis_text2_transform = (
303305 self ._r_label2_position +
304306 Affine2D ().scale (1.0 / 360.0 , 1.0 ) +
0 commit comments