Skip to content

Commit

Permalink
Show traditional error bars when only one data point is present
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jul 30, 2024
1 parent 07a56f7 commit 1802b72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion glue/sample/src/sinter/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,13 @@ def group_dict_func(item: 'sinter.TaskStats') -> _FrozenDict:
for x, y, lbl in zip(xs_label, ys_label, vs_label):
if lbl:
ax.annotate(lbl, (x, y))
if xs_low_high:
if len(xs_low_high) > 1:
ax.fill_between(xs_low_high, ys_low, ys_high, color=color, alpha=0.2, zorder=-100)
elif len(xs_low_high) == 1:
l, = ys_low
h, = ys_high
m = (l + h) / 2
ax.errorbar(xs_low_high, [m], yerr=([m - l], [h - m]), marker='', elinewidth=1, ecolor=color, capsize=5)

if line_fits is not None and len(set(xs_best)) >= 2:
x_scale, y_scale = line_fits
Expand Down

0 comments on commit 1802b72

Please sign in to comment.