Skip to content

Commit 6eada63

Browse files
aloctavodiatwiecki
authored andcommitted
improve aesthetics
1 parent c362db5 commit 6eada63

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

pymc3/plots/compareplot.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,20 @@ def compare_plot(comp_df, ax=None):
2424
if ax is None:
2525
_, ax = plt.subplots()
2626

27-
yticks_pos = np.linspace(0, -1, (comp_df.shape[0] * 2) - 1)
28-
yticks_labels = np.repeat(comp_df.index, 2)[1:]
27+
yticks_pos, step = np.linspace(0, -1, (comp_df.shape[0] * 2) - 1, retstep=True)
28+
yticks_pos[1::2] = yticks_pos[1::2] + step / 2
29+
30+
yticks_labels = [''] * len(yticks_pos)
31+
yticks_labels[0] = comp_df.index[0]
32+
yticks_labels[1::2] = comp_df.index[1:]
2933

3034
data = comp_df.values
3135
min_ic = data[0, 0]
3236

33-
ax.errorbar(x=data[:, 0], y=yticks_pos[::2], xerr=data[:, 4], fmt='ko', mfc='None', mew=1)
34-
ax.errorbar(x=data[1:, 0], y=yticks_pos[1::2], xerr=data[1:, 5], fmt='^', color='grey')
37+
ax.errorbar(x=data[:, 0], y=yticks_pos[::2], xerr=data[:, 4],
38+
fmt='ko', mfc='None', mew=1)
39+
ax.errorbar(x=data[1:, 0], y=yticks_pos[1::2],
40+
xerr=data[1:, 5], fmt='^', color='grey')
3541

3642
ax.plot(data[:, 0] - (2 * data[:, 1]), yticks_pos[::2], 'ko')
3743
ax.axvline(min_ic, ls='--', color='grey')

0 commit comments

Comments
 (0)