If you run your code and get the error message like bellow:
AttributeError:'Rectangle' object has no property 'normed'
the thing you should know is that the library (python matplotlib) you are using has been updated (comparing to the tutorial you are following), there is no
normed property any more.
normedattribute in the code to
stacked = True
see example below:
plt.hist(data, density=True, stacked=True)
density=Truerepresents the frequency distribution
density=Falserepresents the probability density distribution