We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b17e58e commit 6e63064Copy full SHA for 6e63064
labellines/core.py
@@ -196,7 +196,7 @@ def labelLines(
196
197
for i, line in enumerate(all_lines):
198
xdata, _ = normalize_xydata(line)
199
- minx, maxx = min(xdata), max(xdata)
+ minx, maxx = np.nanmin(xdata), np.nanmax(xdata)
200
for j, xv in enumerate(xvals): # type: ignore
201
ok_matrix[i, j] = minx < xv < maxx
202
@@ -223,7 +223,7 @@ def labelLines(
223
224
# Move xlabel if it is outside valid range
225
226
- xmin, xmax = min(xdata), max(xdata)
+ xmin, xmax = np.nanmin(xdata), np.nanmax(xdata)
227
if not (xmin <= xv <= xmax):
228
warnings.warn(
229
(
0 commit comments