Skip to content

Commit 6fed90d

Browse files
authored
Fix annot with text (#56)
When pass text for heatmap annot, error with `TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''`
1 parent 8a9d087 commit 6fed90d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/marsilea/plotter/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ def _format_labels(labels, fmt):
1010

1111

1212
def _format_label(a, fmt):
13-
if np.isnan(a):
14-
a = ""
1513
if isinstance(fmt, str):
1614
label = _auto_format_str(fmt, a)
1715
elif callable(fmt):
1816
label = fmt(a)
17+
elif np.isnan(a):
18+
a = ""
1919
else:
2020
raise TypeError("fmt must be a str or callable")
2121
return label

0 commit comments

Comments
 (0)