void macro(){ auto c1 = new TCanvas(); c1->Divide(2,1); auto graphT = new TGraph("fasi.dat", "%lg %lg %*lg"); auto graphTE = new TGraphErrors("fasi.dat","%lg %lg %lg"); auto fitT = new TF1("TF1", "[0]*180*TMath::ATan(1/([1]*x*TMath::Pi()*2))/Tmath::Pi()", 4000, 6000); fitT->SetParameters(1,1); c1->cd(1); graphT->Draw(); graphT->Fit(fitT); std::cout << "\n \n \n"; c1->cd(2); graphTE->Draw(); graphTE->Fit(fitT); c1->Print("prova.pdf", ".pdf"); }