@@ -1083,10 +1083,10 @@ def hlines(self, y, xmin, xmax, colors=None, linestyles='solid',
10831083 lines ._internal_update (kwargs )
10841084
10851085 if len (y ) > 0 :
1086- minx = min (xmin . min ( ), xmax . min ( ))
1087- maxx = max (xmin . max ( ), xmax . max ( ))
1088- miny = y . min ( )
1089- maxy = y . max ( )
1086+ minx = min (np . nanmin ( xmin ), np . nanmin ( xmax ))
1087+ maxx = max (np . nanmax ( xmin ), np . nanmax ( xmax ))
1088+ miny = np . nanmin ( y )
1089+ maxy = np . nanmax ( y )
10901090
10911091 corners = (minx , miny ), (maxx , maxy )
10921092
@@ -1162,10 +1162,10 @@ def vlines(self, x, ymin, ymax, colors=None, linestyles='solid',
11621162 lines ._internal_update (kwargs )
11631163
11641164 if len (x ) > 0 :
1165- minx = x . min ( )
1166- maxx = x . max ( )
1167- miny = min (ymin . min ( ), ymax . min ( ))
1168- maxy = max (ymin . max ( ), ymax . max ( ))
1165+ minx = np . nanmin ( x )
1166+ maxx = np . nanmax ( x )
1167+ miny = min (np . nanmin ( ymin ), np . nanmin ( ymax ))
1168+ maxy = max (np . nanmax ( ymin ), np . nanmax ( ymax ))
11691169
11701170 corners = (minx , miny ), (maxx , maxy )
11711171 self .update_datalim (corners )
@@ -2674,7 +2674,7 @@ def sign(x):
26742674 extrema = max (x0 , x1 ) if dat >= 0 else min (x0 , x1 )
26752675 length = abs (x0 - x1 )
26762676
2677- if err is None :
2677+ if err is None or np . size ( err ) == 0 :
26782678 endpt = extrema
26792679 elif orientation == "vertical" :
26802680 endpt = err [:, 1 ].max () if dat >= 0 else err [:, 1 ].min ()
@@ -3504,7 +3504,9 @@ def apply_mask(arrays, mask): return [array[mask] for array in arrays]
35043504 f"'{ dep_axis } err' (shape: { np .shape (err )} ) must be a "
35053505 f"scalar or a 1D or (2, n) array-like whose shape matches "
35063506 f"'{ dep_axis } ' (shape: { np .shape (dep )} )" ) from None
3507- if np .any (err < - err ): # like err<0, but also works for timedelta.
3507+ res = np .zeros_like (err , dtype = bool ) # Default in case of nan
3508+ if np .any (np .less (err , - err , out = res , where = (err == err ))):
3509+ # like err<0, but also works for timedelta and nan.
35083510 raise ValueError (
35093511 f"'{ dep_axis } err' must not contain negative values" )
35103512 # This is like
0 commit comments