Hello, first let me say I really appreciate the quality of work you put into your blog. I was going through your post on the Gamma-Gamma model (https://juanitorduz.github.io/gamma_gamma_pymc/) and noticed something was weird with the error bars. Then I found out that Mattplotlib handles the error bars in a weird manner. They are actually +/- relative to the data. This was making your error bars much wider than they are supposed to be. Here is a quick and simple fix to get the proper width.
fig, ax = plt.subplots(figsize=(8, 8))
y = pymc_ceap.mean(axis=0)
err = az.hdi(ary=pymc_ceap, hdi_prob=0.8).T
offsets = np.abs(err - y[None, :])
ax.errorbar(
x=ggf_ceap,
y=y,
yerr=offsets,
fmt="o",
ecolor="C6",
markeredgecolor="C1",
markerfacecolor="C1",
markersize=5,
alpha=0.5,
capsize=2,
)
ax.axline(
xy1=(0, 0),
slope=1,
color="black",
linestyle="--",
label="diagonal"
)
ax.legend(loc="upper left")
ax.set(title="Model Comparison", xlabel="lifetimes", ylabel="pymc");
Hello, first let me say I really appreciate the quality of work you put into your blog. I was going through your post on the Gamma-Gamma model (https://juanitorduz.github.io/gamma_gamma_pymc/) and noticed something was weird with the error bars. Then I found out that Mattplotlib handles the error bars in a weird manner. They are actually +/- relative to the data. This was making your error bars much wider than they are supposed to be. Here is a quick and simple fix to get the proper width.