Skip to content

Commit 1a87dbf

Browse files
fonnesbecktwiecki
authored andcommitted
Fixed text_size argument in plot_posterior (#2304)
1 parent c761c5d commit 1a87dbf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pymc3/plots/artists.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ def display_ref_val(ref_val):
6464
ax.axvline(ref_val, ymin=0.02, ymax=.75, color='g',
6565
linewidth=4, alpha=0.65)
6666
ax.text(trace_values.mean(), plot_height * 0.6, ref_in_posterior,
67-
size=14, horizontalalignment='center')
67+
size=text_size, horizontalalignment='center')
6868

6969
def display_rope(rope):
7070
ax.plot(rope, (plot_height * 0.02, plot_height * 0.02),
7171
linewidth=20, color='r', alpha=0.75)
72-
text_props = dict(size=16, horizontalalignment='center', color='r')
72+
text_props = dict(size=text_size, horizontalalignment='center', color='r')
7373
ax.text(rope[0], plot_height * 0.14, rope[0], **text_props)
7474
ax.text(rope[1], plot_height * 0.14, rope[1], **text_props)
7575

@@ -102,13 +102,13 @@ def display_hpd():
102102
plot_height * 0.02), linewidth=4, color='k')
103103
ax.text(hpd_intervals[0], plot_height * 0.07,
104104
hpd_intervals[0].round(round_to),
105-
size=16, horizontalalignment='right')
105+
size=text_size, horizontalalignment='right')
106106
ax.text(hpd_intervals[1], plot_height * 0.07,
107107
hpd_intervals[1].round(round_to),
108-
size=16, horizontalalignment='left')
108+
size=text_size, horizontalalignment='left')
109109
ax.text((hpd_intervals[0] + hpd_intervals[1]) / 2, plot_height * 0.2,
110110
format_as_percent(1 - alpha_level) + ' HPD',
111-
size=16, horizontalalignment='center')
111+
size=text_size, horizontalalignment='center')
112112

113113
def format_axes():
114114
ax.yaxis.set_ticklabels([])
@@ -119,7 +119,7 @@ def format_axes():
119119
ax.yaxis.set_ticks_position('none')
120120
ax.xaxis.set_ticks_position('bottom')
121121
ax.tick_params(axis='x', direction='out', width=1, length=3,
122-
color='0.5')
122+
color='0.5', labelsize=text_size)
123123
ax.spines['bottom'].set_color('0.5')
124124

125125
def set_key_if_doesnt_exist(d, key, value):

pymc3/plots/posteriorplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def plot_posterior(trace, varnames=None, transform=identity_transform, figsize=N
2222
figsize : figure size tuple
2323
If None, size is (12, num of variables * 2) inch
2424
text_size : int
25-
Text size of the point_estimates and HPD (Default:16)
25+
Text size of the point_estimates, axis ticks, and HPD (Default:16)
2626
alpha_level : float
2727
Defines range for High Posterior Density
2828
round_to : int

0 commit comments

Comments
 (0)