python: plotting a histogram with a function line on top
问题 I'm trying to do a little bit of distribution plotting and fitting in Python using SciPy for stats and matplotlib for the plotting. I'm having good luck with some things like creating a histogram: seed(2) alpha=5 loc=100 beta=22 data=ss.gamma.rvs(alpha,loc=loc,scale=beta,size=5000) myHist = hist(data, 100, normed=True) Brilliant! I can even take the same gamma parameters and plot the line function of the probability distribution function (after some googling): rv = ss.gamma(5,100,22) x = np