Re: Line of best fit

2014-03-31 Thread Steven D'Aprano
On Mon, 31 Mar 2014 04:29:15 -0700, Jamie Mitchell wrote: > I am new to python so apologies for the ignorance with this question. > > How would I apply a line of best fit to a plot? That depends on what software you are using to generate the plot. I see you have this line of code: > plt.plot(h

Re: Line of best fit

2014-03-31 Thread Sturla Molden
Roy Smith wrote: > Please tell us more about the environment you're working in. I'm > guessing from the fact that you're calling plt.plot(), that you've > already got some add-on modules loaded. Pandas, maybe? Probably matplotlib.pyplot -- https://mail.python.org/mailman/listinfo/python-li

Re: Line of best fit

2014-03-31 Thread Moritz Beber
None of these are in the standard library but why re-invent the wheel? Using numpy: http://docs.scipy.org/doc/numpy/reference/generated/numpy.polyfit.html scipy: http://docs.scipy.org/doc/scipy-0.13.0/reference/generated/scipy.stats.linregress.html statsmodels: http://statsmodels.sourceforge.net

Re: Line of best fit

2014-03-31 Thread Roy Smith
In article <0fb15100-15e8-46d6-a38f-b187c7012...@googlegroups.com>, Jamie Mitchell wrote: > I am new to python so apologies for the ignorance with this question. > > How would I apply a line of best fit to a plot? Python has nothing built-in which does that, but there are plenty of add-on mod