Plot from a data file

Hi, I have a basic problem but I am newby in ROOT. I wanto to read a data ascii file and plot it. But I can’t I did the following:

gROOT->Reset();
ifstream in;

in.open(“basic.dat”,ios::in);
Int_t lines=0;
Float_t x,y,z;
while(1){
in >> x >> y >> z;
if (!in.good()) break;
if (lines <5>Draw(“AC*”);

But this doesn’t work. What I is wrong?
Thks.

It seems you are using TGraph. One the TGraph constuctor makes a TGraph from an ASCII file. Have a look at:
root.cern.ch/root/htmldoc//TGraph.html
The last constructor listed there is the one you are looking for.