updated statistics exercise instructions
This commit is contained in:
@@ -15,7 +15,7 @@ ax1.set_xticks(range(1, 7))
|
||||
ax1.set_xlabel('x')
|
||||
ax1.set_ylim(0, 98)
|
||||
ax1.set_ylabel('Frequency')
|
||||
fs = fsC
|
||||
fs = dict(**fsC)
|
||||
fs['color'] = [fsC['facecolor'], fsE['facecolor']]
|
||||
del fs['facecolor']
|
||||
ax1.hist([x2, x1], bins, **fs)
|
||||
@@ -26,9 +26,11 @@ ax2.set_xlabel('x')
|
||||
ax2.set_ylim(0, 0.23)
|
||||
ax2.set_ylabel('Probability')
|
||||
ax2.plot([0.2, 6.8], [1.0/6.0, 1.0/6.0], zorder=-10, **lsAm)
|
||||
if mpl_major > 1:
|
||||
ax2.hist([x2, x1], bins, density=True, zorder=-5, **fs)
|
||||
else:
|
||||
ax2.hist([x2, x1], bins, normed=True, zorder=-5, **fs)
|
||||
h1, b1 = np.histogram(x1, bins)
|
||||
h2, b2 = np.histogram(x2, bins)
|
||||
h1 = h1/np.sum(h1)
|
||||
h2 = h2/np.sum(h2)
|
||||
ax2.bar(b1[:-1]+0.3, h1, zorder=-5, width=0.4, **fsC)
|
||||
ax2.bar(b2[:-1]+0.7, h2, zorder=-5, width=0.4, **fsE)
|
||||
fig.subplots_adjust(left=0.125)
|
||||
fig.savefig('diehistograms.pdf')
|
||||
|
||||
Reference in New Issue
Block a user