@@ -809,6 +809,7 @@ def _proportional_y(self):
809
809
y = y / (self ._boundaries [- 1 ] - self ._boundaries [0 ])
810
810
else :
811
811
y = self .norm (self ._boundaries .copy ())
812
+ y = np .ma .filled (y , np .nan )
812
813
if self .extend == 'min' :
813
814
# Exclude leftmost interval of y.
814
815
clen = y [- 1 ] - y [1 ]
@@ -819,21 +820,22 @@ def _proportional_y(self):
819
820
clen = y [- 2 ] - y [0 ]
820
821
automin = (y [1 ] - y [0 ]) / clen
821
822
automax = (y [- 2 ] - y [- 3 ]) / clen
822
- else :
823
+ elif self . extend == 'both' :
823
824
# Exclude leftmost and rightmost intervals in y.
824
825
clen = y [- 2 ] - y [1 ]
825
826
automin = (y [2 ] - y [1 ]) / clen
826
827
automax = (y [- 2 ] - y [- 3 ]) / clen
827
- extendlength = self ._get_extension_lengths (self .extendfrac ,
828
- automin , automax ,
829
- default = 0.05 )
828
+ if self .extend in ('both' , 'min' , 'max' ):
829
+ extendlength = self ._get_extension_lengths (self .extendfrac ,
830
+ automin , automax ,
831
+ default = 0.05 )
830
832
if self .extend in ('both' , 'min' ):
831
833
y [0 ] = 0. - extendlength [0 ]
832
834
if self .extend in ('both' , 'max' ):
833
835
y [- 1 ] = 1. + extendlength [1 ]
834
836
yi = y [self ._inside ]
835
837
norm = colors .Normalize (yi [0 ], yi [- 1 ])
836
- y [self ._inside ] = norm (yi )
838
+ y [self ._inside ] = np . ma . filled ( norm (yi ), np . nan )
837
839
return y
838
840
839
841
def _mesh (self ):
0 commit comments