I use a root program to plot the data of my experiment, and now I would like to get the (x ,y) points of one of the graphs that I get in a text format, so I can plot it with another program.
is it posible to do that?
Thank you very much,
Berta
Hi Berta,
you can use something like
Int_t n = gr->GetN();
Double_t *px = gr->GetX();
Double_t *py = gr->GetY();
ofstream os("graph.txt");
Int_t i;
for (i = 0; i < n; ++i) {
os << "(" << px[i] << "," << py[i] << ")\n";
}
os.close();
Maksim
Marksim
Thank you very much, your advice has been very usefull to me.
Berta