Skip to content

Commit

Permalink
adde bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
podgorki committed Dec 3, 2024
1 parent fc80fa4 commit 945f8f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchmetrics/utilities/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def plot_confusion_matrix(
fig, axs = plt.subplots(nrows=rows, ncols=cols, constrained_layout=True) if ax is None else (ax.get_figure(), ax)
axs = trim_axs(axs, nb)
for i in range(nb):
ax = axs[i] if rows != 1 and cols != 1 else axs
ax = axs[i] if rows != 1 or cols != 1 else axs
if fig_label is not None:
ax.set_title(f"Label {fig_label[i]}", fontsize=15)
im = ax.imshow(confmat[i].cpu().detach() if confmat.ndim == 3 else confmat.cpu().detach(), cmap=cmap)
Expand Down

0 comments on commit 945f8f9

Please sign in to comment.