hallo;
I have two files.dat / f1.dat and f2.dat
in each file, I have two columns
When I write a program to draw the line y=f(x) in f1 or f2 I have no problem.
My problem when I draw the two in a one canvas for superposed
Double_t *x1 = new Double_t[249];
Double_t *y1 = new Double_t[249];
Double_t vX1, vY1;
Int_t vNData = 0;
ifstream vInput;
vInput.open(Form("%sf1.dat",dir.Data()));
while (1) {
vInput >> vX1 >> vY1;
if (!vInput.good()) break;
x1[vNData] = vX1;
y1[vNData] = vY1;
vNData++;
}//while
vInput.close();
gr1 = new TGraph(vNData,x1,y1);
gr1->Draw("AC");
Double_t *x2 = new Double_t[249];
Double_t *y2 = new Double_t[249];
Double_t vX2, vY2;
Int_t vNData = 0;
ifstream vInput;
vInput.open(Form("%sf2.dat",dir.Data()));
while (1) {
vInput >> vX2 >> vY2;
if (!vInput.good()) break;
x2[vNData] = vX2;
y2[vNData] = vY2;
vNData++;
}//while
vInput.close();
gr2 = new TGraph(vNData,x2,y2);
gr2->SetLineWidth(4);
gr2->SetLineColor(5);
gr2->Draw("CP);