I have a TGraphErrors object and I only want to fit a landau distribution on a certain range. However, I want to plot the fitted function to a larger range, so I do
TGraphErrors *plot = new TGraphErrors(stuff); \\this works plot->Fit("landau","N","",0.5.25); \\this works TF1 *fit = plot->GetFunction("landau"); \\get fit function fit->SetRange(0,7); \\larger range for fit function fit->Draw("same"); \\plot it
This doesn’t work though. The first two lines are fine, but I get errors when I use SetRange() or Draw(). Can anyone help?