Problems with TGraph2D

Hi all,

I am trying to plot a data file that has three columns using TGraph2D. The code is:

TGraph2D *g = new TGraph2D("Myfile.dat"); gStyle->SetPalette(1); g->Draw("surf1");

The file .dat has 169 rows and contains negative values.

But it is generating an error

Warning: template pair duplicate definition /usr/local/root/cint/cint/stl/_pair.h:31: Warning: template reverse_iterator duplicate definition /usr/local/root/cint/cint/stl/_iterator.h:269: Warning: template allocator duplicate definition /usr/local/root/cint/cint/stl/defalloc.h:134: Warning: template vector duplicate definition /usr/local/root/cint/cint/stl/_vector.h:44: Warning in <TROOT::Append>: Replacing existing TGraph2D: Graph2D (Potential memory leak). Error in <TGraph2D::TGraph2D>: Cannot open file: resultados.dat, TGraph2D is Zombie Error in <TGraph2D::Paint>: Empty TGraph2D

I don’t know what is the problem or what is missing??

Any suggestion is welcome?

Thanks for your attention.


Can you send a running example ?

Could you provide the shortest possible RUNNING script reproducing your problem as well as your input file?


Excuse me I don’t understand your question.

What is a running??. I am new using ROOT C++.

Send us a small example (script and data) which reproduces your problem.

I solved the problem, I was writing the name of the file to load wrong.

Thank you very much for attention

You’re welcome :slight_smile: