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 @@ -398,6 +398,7 @@ class RadialLocator(mticker.Locator):
398
398
:class:`~matplotlib.ticker.Locator` (which may be different
399
399
depending on the scale of the *r*-axis.
400
400
"""
401
+
401
402
def __init__ (self , base , axes = None ):
402
403
self .base = base
403
404
self ._axes = axes
@@ -429,6 +430,11 @@ def refresh(self):
429
430
# docstring inherited
430
431
return self .base .refresh ()
431
432
433
+ def nonsingular (self , vmin , vmax ):
434
+ # docstring inherited
435
+ return ((0 , 1 ) if (vmin , vmax ) == (- np .inf , np .inf ) # Init. limits.
436
+ else self .base .nonsingular (vmin , vmax ))
437
+
432
438
def view_limits (self , vmin , vmax ):
433
439
vmin , vmax = self .base .view_limits (vmin , vmax )
434
440
if vmax > vmin :
Original file line number Diff line number Diff line change @@ -2211,6 +2211,17 @@ def test_log_scales_invalid():
2211
2211
ax .set_ylim (- 1 , 10 )
2212
2212
2213
2213
2214
+ def test_polar_no_data ():
2215
+ plt .subplot (projection = "polar" )
2216
+ ax = plt .gca ()
2217
+ assert ax .get_rmin () == 0 and ax .get_rmax () == 1
2218
+ plt .close ("all" )
2219
+ # Used to behave differently (by triggering an autoscale with no data).
2220
+ plt .polar ()
2221
+ ax = plt .gca ()
2222
+ assert ax .get_rmin () == 0 and ax .get_rmax () == 1
2223
+
2224
+
2214
2225
@image_comparison (['stackplot_test_image' , 'stackplot_test_image' ])
2215
2226
def test_stackplot ():
2216
2227
fig = plt .figure ()
You can’t perform that action at this time.
0 commit comments