Graphmatica curve fit data plot
Plt.plot(xData, yData, label='Data', marker='o') Popt, pcov = optimize.curve_fit(func, xData, yData) TrialX = np.linspace(xData, xData, 1000)įitted = np.polyfit(xData, yData, 10) If you scale them, the fit is remarkable better: xData = np.load('xData.npy')*10**5 In this case, the graph shows your data has extremely small x and y values.
Numerical algorithms tend to work better when not fed extremely small (or large) numbers. ot(xData, yData, label='Data', marker='o') Popt, pcov = curve_fit(func, xData, yData) TrialX = numpy.linspace(xData,xData,1000)įitted = numpy.polyfit(xData, yData, 10) I really can't see any reason why this wouldn't work but it just produces a strait line, no idea why!Īny help would be much appreciated from _future_ import division I've been trying to fit an exponential to some data for a while using _fit but i'm having real difficulty.