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):
13841384 def autoscale_None (self , A ):
13851385 """Set *vmin* and *vmax*."""
13861386 A = np .asanyarray (A )
1387- if self .vmax is None and A .size :
1387+ if self ._halfrange is None and A .size :
13881388 self .autoscale (A )
13891389
13901390 @property
Original file line number Diff line number Diff line change @@ -418,6 +418,12 @@ def test_CenteredNorm():
418418 norm .autoscale_None ([1 , 2 ])
419419 assert norm .vmax + norm .vmin == 2 * vcenter
420420
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+
421427 # Check that halfrange input works correctly.
422428 x = np .random .normal (size = 10 )
423429 norm = mcolors .CenteredNorm (vcenter = 0.5 , halfrange = 0.5 )
You can’t perform that action at this time.
0 commit comments