File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3089,13 +3089,16 @@ def handle_single_axis(
30893089 # streamplot; it is defined relative to x1-x0 but has
30903090 # no absolute term (e.g. "+1e-8") to avoid issues when working with
30913091 # datasets where all values are tiny (less than 1e-8).
3092- tol = 1e-5 * abs (x1 - x0 )
3093- # Index of largest element < x0 + tol, if any.
3094- i0 = stickies .searchsorted (x0 + tol ) - 1
3095- x0bound = stickies [i0 ] if i0 != - 1 else None
3096- # Index of smallest element > x1 - tol, if any.
3097- i1 = stickies .searchsorted (x1 - tol )
3098- x1bound = stickies [i1 ] if i1 != len (stickies ) else None
3092+ if len (stickies ):
3093+ tol = 1e-5 * abs (x1 - x0 )
3094+ # Index of largest element < x0 + tol, if any.
3095+ i0 = stickies .searchsorted (x0 + tol ) - 1
3096+ x0bound = stickies [i0 ] if i0 != - 1 else None
3097+ # Index of smallest element > x1 - tol, if any.
3098+ i1 = stickies .searchsorted (x1 - tol )
3099+ x1bound = stickies [i1 ] if i1 != len (stickies ) else None
3100+ else :
3101+ x0bound = x1bound = None
30993102
31003103 # Add the margin in figure space and then transform back, to handle
31013104 # non-linear scales.
You can’t perform that action at this time.
0 commit comments