Skip to content

Commit

Permalink
Fix percentage in loo pit legend
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh261998 committed Jul 25, 2021
1 parent ae83908 commit 4f66cd9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion arviz/plots/backends/bokeh/loopitplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ def plot_loo_pit(
fill_kwargs.setdefault(
"step", "mid" if plot_kwargs["drawstyle"] == "steps-mid" else None
)
fill_kwargs.setdefault("legend_label", "{:.3g}% credible interval".format(hdi_prob))
fill_kwargs.setdefault(
"legend_label", "{:.3g}% credible interval".format(hdi_prob * 100)
)
elif use_hdi:
if hdi_kwargs is None:
hdi_kwargs = {}
Expand Down
4 changes: 2 additions & 2 deletions arviz/plots/backends/matplotlib/loopitplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def plot_loo_pit(
fill_kwargs.setdefault(
"step", "mid" if plot_kwargs["drawstyle"] == "steps-mid" else None
)
fill_kwargs.setdefault("label", "{:.3g}% credible interval".format(hdi_prob))
fill_kwargs.setdefault("label", "{:.3g}% credible interval".format(hdi_prob * 100))
elif use_hdi:
if hdi_kwargs is None:
hdi_kwargs = {}
Expand Down Expand Up @@ -137,7 +137,7 @@ def plot_loo_pit(
ax.tick_params(labelsize=xt_labelsize)
if legend:
if not (use_hdi or (ecdf and ecdf_fill)):
label = "{:.3g}% credible interval".format(hdi_prob) if ecdf else "Uniform"
label = "{:.3g}% credible interval".format(hdi_prob * 100) if ecdf else "Uniform"
ax.plot([], label=label, **plot_unif_kwargs)
ax.legend()

Expand Down

0 comments on commit 4f66cd9

Please sign in to comment.