@@ -809,6 +809,7 @@ def _proportional_y(self):
809809 y = y / (self ._boundaries [- 1 ] - self ._boundaries [0 ])
810810 else :
811811 y = self .norm (self ._boundaries .copy ())
812+ y = np .ma .filled (y , np .nan )
812813 if self .extend == 'min' :
813814 # Exclude leftmost interval of y.
814815 clen = y [- 1 ] - y [1 ]
@@ -819,21 +820,22 @@ def _proportional_y(self):
819820 clen = y [- 2 ] - y [0 ]
820821 automin = (y [1 ] - y [0 ]) / clen
821822 automax = (y [- 2 ] - y [- 3 ]) / clen
822- else :
823+ elif self . extend == 'both' :
823824 # Exclude leftmost and rightmost intervals in y.
824825 clen = y [- 2 ] - y [1 ]
825826 automin = (y [2 ] - y [1 ]) / clen
826827 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 )
830832 if self .extend in ('both' , 'min' ):
831833 y [0 ] = 0. - extendlength [0 ]
832834 if self .extend in ('both' , 'max' ):
833835 y [- 1 ] = 1. + extendlength [1 ]
834836 yi = y [self ._inside ]
835837 norm = colors .Normalize (yi [0 ], yi [- 1 ])
836- y [self ._inside ] = norm (yi )
838+ y [self ._inside ] = np . ma . filled ( norm (yi ), np . nan )
837839 return y
838840
839841 def _mesh (self ):
0 commit comments