Skip to content

Commit

Permalink
Changed size of rope text in posteriorplot bokeh
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh261998 committed Feb 18, 2021
1 parent 73e1e5b commit 363ae53
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions arviz/plots/backends/bokeh/posteriorplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ def display_ref_val(max_data):
)
ax.line([val, val], [0, 0.8 * max_data], line_color="darkorange", line_alpha=0.65)

ax.text(x=[values.mean()], y=[max_data * 0.6], text=[ref_in_posterior], text_color='darkorange', text_align="center")
ax.text(
x=[values.mean()],
y=[max_data * 0.6],
text=[ref_in_posterior],
text_color="darkorange",
text_align="center",
)

def display_rope(max_data):
if rope is None:
Expand Down Expand Up @@ -189,17 +195,21 @@ def display_rope(max_data):
line_alpha=0.7,
)
probability_within_rope = ((values > vals[0]) & (values <= vals[1])).mean()
text_props = dict(
text_color="green", text_align="center"
)
text_props = dict(text_color="green", text_align="center")
ax.text(
x=values.mean(),
y=[max_data * 0.45],
text=[f"{format_as_percent(probability_within_rope, 1)} in ROPE"],
**text_props,
)

ax.text(x=vals, y=[max_data * 0.2, max_data * 0.2], text=rope_text, **text_props)
ax.text(
x=vals,
y=[max_data * 0.2, max_data * 0.2],
text_font_size="{}pt".format(ax_labelsize),
text=rope_text,
**text_props,
)

def display_point_estimate(max_data):
if not point_estimate:
Expand Down

0 comments on commit 363ae53

Please sign in to comment.