File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,7 @@ class RadialLocator(mticker.Locator):
385
385
:class:`~matplotlib.ticker.Locator` (which may be different
386
386
depending on the scale of the *r*-axis.
387
387
"""
388
+
388
389
def __init__ (self , base , axes = None ):
389
390
self .base = base
390
391
self ._axes = axes
@@ -416,6 +417,11 @@ def refresh(self):
416
417
# docstring inherited
417
418
return self .base .refresh ()
418
419
420
+ def nonsingular (self , vmin , vmax ):
421
+ # docstring inherited
422
+ return ((0 , 1 ) if (vmin , vmax ) == (- np .inf , np .inf ) # Init. limits.
423
+ else self .base .nonsingular (vmin , vmax ))
424
+
419
425
def view_limits (self , vmin , vmax ):
420
426
vmin , vmax = self .base .view_limits (vmin , vmax )
421
427
if vmax > vmin :
Original file line number Diff line number Diff line change @@ -2240,6 +2240,17 @@ def test_log_scales_invalid():
2240
2240
ax .set_ylim (- 1 , 10 )
2241
2241
2242
2242
2243
+ def test_polar_no_data ():
2244
+ plt .subplot (projection = "polar" )
2245
+ ax = plt .gca ()
2246
+ assert ax .get_rmin () == 0 and ax .get_rmax () == 1
2247
+ plt .close ("all" )
2248
+ # Used to behave differently (by triggering an autoscale with no data).
2249
+ plt .polar ()
2250
+ ax = plt .gca ()
2251
+ assert ax .get_rmin () == 0 and ax .get_rmax () == 1
2252
+
2253
+
2243
2254
@image_comparison (['stackplot_test_image' , 'stackplot_test_image' ])
2244
2255
def test_stackplot ():
2245
2256
fig = plt .figure ()
You can’t perform that action at this time.
0 commit comments