I wrote some code to interpret data attained from a dynamic ligth scattering experiment. The plot seems to work and show the linear trend from the plot. However, I need to get the equation of the magenta line in order to get the necessary variables for my project. Does anyone know how to do this? here is the section of code in question:
plt.figure()
plt.errorbar(q**2,1/tau1, 1/(tau1**2)*dtau1,marker='o',linestyle='none')
poptDp, pcovDp = curve_fit(lambda x, *p: x * p[0], q ** 2,1/tau1, p0=[1, 0], bounds=(0, 1000),
sigma=1/(tau1**2)*dtau1, ftol=1e-14, xtol=1e-14) # old: 1e-15
plt.plot(q** 2 , q** 2 * poptDp[0] , color='magenta')
D=poptDp[0]
dD= np.sqrt(np.diag(pcovDp))[0]
plt.xlabel('q$^2$ ($\mathrm{\mu}$m$^{-2}$)')
plt.ylabel('$\Gamma_1$ (s$^{-1}$)')
plt.grid('on')