Skip to content

Commit 609974c

Browse files
JWarmenhoventwiecki
authored andcommitted
HPD label alignment for posterior plot (#2182)
Solves #2090
1 parent 22d5ecd commit 609974c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pymc3/plots/artists.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,15 @@ def display_hpd():
112112
hpd_intervals = hpd(trace_values, alpha=alpha_level)
113113
ax.plot(hpd_intervals, (plot_height * 0.02,
114114
plot_height * 0.02), linewidth=4, color='k')
115-
text_props = dict(size=text_size, horizontalalignment='center')
116115
ax.text(hpd_intervals[0], plot_height * 0.07,
117-
hpd_intervals[0].round(round_to), **text_props)
116+
hpd_intervals[0].round(round_to),
117+
size=16, horizontalalignment='right')
118118
ax.text(hpd_intervals[1], plot_height * 0.07,
119-
hpd_intervals[1].round(round_to), **text_props)
119+
hpd_intervals[1].round(round_to),
120+
size=16, horizontalalignment='left')
120121
ax.text((hpd_intervals[0] + hpd_intervals[1]) / 2, plot_height * 0.2,
121-
format_as_percent(1 - alpha_level) + ' HPD', **text_props)
122+
format_as_percent(1 - alpha_level) + ' HPD',
123+
size=16, horizontalalignment='center')
122124

123125
def format_axes():
124126
ax.yaxis.set_ticklabels([])

0 commit comments

Comments
 (0)