Fitting a histogram

I have a TH1F histogram, when I try to fit this histogram with an exponential function through the Fit Panel I get values for the Constant and Slope that are different than the ones I get when I use the Fit Method. The code is attached. Any ideas
hX2G_Alpha_2p2.C (2.22 KB)

In your example, you set the function limits to correspond to the center of the histogram bins. It is likely that when using the Fitpanel, you select slightly different values in such a way that either the lowest or highest bin will be or will not be included in the fit.