File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1384,7 +1384,7 @@ def autoscale(self, A):
1384
1384
def autoscale_None (self , A ):
1385
1385
"""Set *vmin* and *vmax*."""
1386
1386
A = np .asanyarray (A )
1387
- if self .vmax is None and A .size :
1387
+ if self ._halfrange is None and A .size :
1388
1388
self .autoscale (A )
1389
1389
1390
1390
@property
Original file line number Diff line number Diff line change @@ -418,6 +418,12 @@ def test_CenteredNorm():
418
418
norm .autoscale_None ([1 , 2 ])
419
419
assert norm .vmax + norm .vmin == 2 * vcenter
420
420
421
+ # Check that halfrange can be set without setting vcenter and that it is
422
+ # not reset through autoscale_None.
423
+ norm = mcolors .CenteredNorm (halfrange = 1.0 )
424
+ norm .autoscale_None ([1 , 3000 ])
425
+ assert norm .halfrange == 1.0
426
+
421
427
# Check that halfrange input works correctly.
422
428
x = np .random .normal (size = 10 )
423
429
norm = mcolors .CenteredNorm (vcenter = 0.5 , halfrange = 0.5 )
You can’t perform that action at this time.
0 commit comments