Skip to content

Commit

Permalink
fix plot (#1332)
Browse files Browse the repository at this point in the history
* fix plot

* black
  • Loading branch information
teytaud authored Jan 13, 2022
1 parent 666e009 commit c1e83e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nevergrad/benchmark/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,11 @@ def __init__(
# confidence lines
for conf in self._get_confidence_arrays(vals, log=logplot):
plt.plot(vals[xaxis], conf, name_style[optim_name], label=optim_name, alpha=0.1)
text = "{} ({:.3g} <{:.3g}>)".format(optim_name, vals["loss"][-1], vals["loss"][-2])
text = "{} ({:.3g} <{:.3g}>)".format(
optim_name,
vals["loss"][-1],
vals["loss"][-2] if len(vals["loss"]) > 2 else float("nan"),
)
if vals[xaxis].size:
legend_infos.append(LegendInfo(vals[xaxis][-1], vals["loss"][-1], line, text))
if not (np.isnan(upperbound) or np.isinf(upperbound)):
Expand Down

0 comments on commit c1e83e2

Please sign in to comment.