Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki authored Jul 3, 2023
1 parent 18fa6b1 commit 1dcc07f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/torchmetrics/utilities/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ def plot_single_or_multi_val(
xlim = ax.get_xlim()
factor = 0.1 * (xlim[1] - xlim[0])

y_ = [lower_bound, upper_bound] if lower_bound and upper_bound else []
ax.hlines(y_, xlim[0], xlim[1], linestyles="dashed", colors="k")
y_lines = [ ]
if lower_bound is not None:
y_lines.append(lower_bound)
if upper_bound is not None:
y_lines.append(upper_bound)
ax.hlines(y_lines, xlim[0], xlim[1], linestyles="dashed", colors="k")
if higher_is_better is not None:
if lower_bound is not None and not higher_is_better:
ax.set_xlim(xlim[0] - factor, xlim[1])
Expand Down

0 comments on commit 1dcc07f

Please sign in to comment.