Skip to content

Commit 9be3d4d

Browse files
authored
cast figure titles to string to avoid datetime showing as int (#124)
1 parent c204818 commit 9be3d4d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xvec/plotting.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _plot_faceted(arr, axs, row, col, hue, geometry, cmap_params=None, **kwargs)
133133
)
134134
if i_r == 0:
135135
axs[0, i_c].set_title(
136-
f"{col} = {arr[col][i_c].item()}", fontsize="small"
136+
f"{col} = {arr[col][i_c].astype(str).item()}", fontsize="small"
137137
)
138138
if i_c == len(arr[col]) - 1:
139139
axs[i_r, -1].yaxis.set_label_position("right")
@@ -154,7 +154,9 @@ def _plot_faceted(arr, axs, row, col, hue, geometry, cmap_params=None, **kwargs)
154154
cmap_params,
155155
**kwargs,
156156
)
157-
axs_flat[i_c].set_title(f"{col} = {arr[col][i_c].item()}", fontsize="small")
157+
axs_flat[i_c].set_title(
158+
f"{col} = {arr[col][i_c].astype(str).item()}", fontsize="small"
159+
)
158160
return arr[col].shape[0] # Return used axes count
159161

160162

0 commit comments

Comments
 (0)