I’m trying to get a pointer to the TGraph created by TNtuple->Draw(). When I use gPad->GetListOfPrimitives(), I get the actual x and y arrays printed out point by point, as if the objects created are series of markers. But I know that there are TGraph objects in the pad, because in the graphics editor I can change the graph’s line style, etc. In the object inspector there is a TGraph::Graph, but why is it not listed in the list of primitives? Also, in situations where there is more than one Draw command with the “SAME” option, they all seem to have the same name Graph.
So my question is, what is the proper way to get the object made by Draw that will let me change the linestyle, etc?
Thanks for reading/answering,
Some example code and output that might explain this more clearly
TFile *temp=new TFile("analyse.root", "RECREATE");
TNtuple *ntuple = new TNtuple("TCITC","TCITC","tc:itc");
ntuple->ReadFile("R2Out_32_3.dat"); //text file with format %f %f \n etc..)
TCanvas *c1 = new TCanvas("c1");
//TList *li = new TList(gPad->GetListOfPrimitives());
//li->Print(); //Printing the list doesn't print all of the objects for some reason, perhaps there's some option needed?
Collection name='TList', class='TList', size=4
TFrame X1=0.000000 Y1=0.000000 X2=11.000000 Y2=0.052000 FillColor=19 FillStyle=1001
TH1.Print Name = htemp, Entries= 0, Total sum= 0
TPaveText X1=-1.237500 Y1=0.054925 X2=0.064799 Y2=0.058175 FillColor=19 FillStyle=1001
Collection name='TList', class='TList', size=1
Text X=0.000000 Y=0.000000 Text=itc:tc Font=0 Size=0.000000 Color=0 Align=0
etc... to end of the NTuple TCITC