void Image() { FILE *f = fopen("Image.nap","r"); if (!f) { printf("Could not open Image.nap\n"); return; } char line[300]; float v1,v2,v3,v4,v5,v6,v7,v8; Int_t i = 0; TGraph *g = new TGraph(); TGraph *g1 = new TGraph(); TCanvas *c1 = new TCanvas("c1","c1",800,1000); TH1F *h1=new TH1F ("h1","Elpsarea Histo",100,-400,400); while (fgets(line,160,f)) { if (i>49) { sscanf(&line[0] ,"%g,%g,%g,%g,%g,%g,%g,%g",&v1,&v2,&v3,&v4,&v5,&v6,&v7,&v8); g->SetPoint(i,v2,v3); g1->SetPoint(i,v5,v6); printf ("%g\t", v8); h1.Fill(v8); } i++; } fclose(f); c1->Divide(1,2); g->SetMarkerSize(1); g->SetMarkerColor(20); g->SetMarkerStyle(5); g->SetTitle("Graph from nap file"); g->GetXaxis()->SetTitle("X (micron)"); g->GetYaxis()->SetTitle("Y (micron)"); g->GetXaxis()->CenterTitle(); g->GetYaxis()->CenterTitle(); g->SetMarkerColor(kBlue); g->SetMarkerStyle(21); g->SetMarkerSize(0.5) gStyle->SetTitleSize(0.05, ” “); gStyle->SetTitleSize(0.05, ”xy “); gStyle->SetTitleColor(2,” “); c1->cd(1); g->Draw("AP"); g1->SetLineColor(2); g1->SetLineWidth(1504); g->SetMarkerStyle(6); g1->GetXaxis()->SetTitle("MgrAx"); g1->GetYaxis()->SetTitle("MnrAx"); g1->GetXaxis()->CenterTitle(); g1->GetYaxis()->CenterTitle(); g1->SetMarkerColor(kRed); g1->SetMarkerStyle(21); g1->SetMarkerSize(0.5); g1->SetMarkerStyle(20); c1.cd(2) g1.Draw("AP"); TCanvas *c2 = new TCanvas("c2","Histo for Elps area",600,400); h1->GetXaxis()->SetTitle("Elepse Area Imicron)"); h1->GetYaxis()->SetTitle("Count/bin"); h1->GetXaxis()->CenterTitle(); h1->GetYaxis()->CenterTitle(); h1.Draw(); }