I have a data set. I tried to fit with Root, but it was not successful. However, when I process this data with Excel, there is not any problems. Could you help me, please?
Here is my code
#include <TF1.h>
#include <TGraph.h>
#include <TMarker.h>
#include <TAxis.h>
void heso()
{
TGraph *g0 = new TGraph("factor.txt");
g0->SetLineColor(kRed);
g0->SetMarkerStyle(8);
g0->SetMarkerColor(kRed);
g0->SetMarkerSize(1);
g0->Draw("ACP");
g0->GetYaxis()->SetRangeUser(0, 300000);
TF1 *fit = new TF1("fit", "[0]*(x^[1])", 5, 30);
fit->SetLineColor(kBlue);
g0->Fit("fit");
}
factor.txt (616 Bytes)