{ TCanvas *can = new TCanvas("can","plotz",900,700); TH2D *blank = new TH2D("h2","plot",100,0.,80.,100,0.,4.); ifstream in; in.open("plot.txt"); Float_t x,y; Int_t nlines = 0; TNtuple *ntuple = new TNtuple("ntuple","ntuple example","x:y"); while(1){ in >>x>>y; if(!in.good()) break; ntuple->Fill(x,y); nlines++; } printf("nlines = %d\n",nlines); ntuple->Draw("log10(y/x):x>>h2","x>0"); in.close(); Float_t x_min = 0.1; Float_t x_max = 100.; const Int_t bins = 200; Float_t binW = (x_max-x_min)/(float)bins; Double_t xv[bins], yv[bins]; Double_t *xntuple = ntuple->GetVal(0); Double_t *yntuple = ntuple->GetVal(1); Double_t xaxis, yaxis; for(Int_t b=0; b0) { yaxis = log10(yntuple[b]/xntuple[b]); } else { yaxis = 0; } xv[b] = xaxis; yv[b] = yaxis; } cout << xv[0] << " and " << yv[0] << endl; cout << xv[1] << " and " << yv[1] << endl; }