Is there a way to extract the slope in fitting a Tgrapherror

I looked at the TGraph documentation it doesn’t seems like there is an option that would do it. But it doesn’t make sense to me that this can’t be done easily.

TGraphErrors *gr1 = new TGraphErrors(data_file, “%lg %lg %lg”);

Since the fit parameter doesn’t really show the slope, Is there a way in root to extract the slope easily?
Thanks in advance.

First of all, if you want to get the slope, you must fit with something having a slope (“pol1”) and not just fit a constant (“pol0”). So the code should be

gr1->Fit("pol1"); double slope = gr1->GetFunction("pol1")->GetParameter(1);