Skip to content

Commit 1e7c535

Browse files
Merge pull request CamDavidsonPilon#218 from martinxyz/master
separation_plot.py: fix expected value bar
2 parents fa7f8df + febc2f6 commit 1e7c535

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Chapter2_MorePyMC/separation_plot.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,15 @@ def separation_plot( p, y, **kwargs ):
3737
ix = np.argsort( p[:,i] )
3838
#plot the different bars
3939
bars = ax.bar( np.arange(n), np.ones(n), width=1.,
40-
align = 'center',
4140
color = colors_bmh[ y[ix].astype(int) ],
4241
edgecolor = 'none')
43-
ax.plot( np.arange(n+1)-0.5, np.append(p[ix,i], p[ix,i][-1]), "k",
42+
ax.plot( np.arange(n+1), np.append(p[ix,i], p[ix,i][-1]), "k",
4443
linewidth = 1.,drawstyle="steps-post" )
4544
#create expected value bar.
4645
ax.vlines( [(1-p[ix,i]).sum()], [0], [1] )
4746
#ax.grid(False)
4847
#ax.axis('off')
49-
plt.xlim( -0.5, n-1+0.5)
48+
plt.xlim( 0, n)
5049

5150
plt.tight_layout()
5251

0 commit comments

Comments
 (0)