In [12]:
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt
# import numpy as np
prior_prob = [1./21, 20./21]
post_prob = [0.087, 1-0.087]
plt.bar([0, .7], prior_prob, width=0.2, color='red', label = 'prior distribution', lw =4)
plt.bar([0+0.25, .7+0.25], post_prob, width=0.2, color ='blue', alpha=0.5, label = 'post distribution', lw =4)
plt.legend(loc='best')
plt.xticks([0.12, 0.82], ['Librarian', 'Farmer'])
Out[12]:
In [ ]: