Skip to content

Commit

Permalink
Changed color scheme in plot_posterior in bokeh
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh261998 committed Feb 18, 2021
1 parent 0d9e9e6 commit 73e1e5b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions arviz/plots/backends/bokeh/posteriorplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def display_ref_val(max_data):
val,
format_as_percent(greater_than_ref_probability, 1),
)
ax.line([val, val], [0, 0.8 * max_data], line_color="blue", line_alpha=0.65)
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_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 @@ -185,19 +185,18 @@ def display_rope(max_data):
vals,
(max_data * 0.02, max_data * 0.02),
line_width=linewidth * 5,
line_color="red",
line_color="green",
line_alpha=0.7,
)
probability_within_rope = ((values > vals[0]) & (values <= vals[1])).mean()
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_align="center",
)

text_props = dict(
text_font_size="{}pt".format(ax_labelsize), text_color="black", text_align="center"
**text_props,
)

ax.text(x=vals, y=[max_data * 0.2, max_data * 0.2], text=rope_text, **text_props)
Expand Down

0 comments on commit 73e1e5b

Please sign in to comment.