I am working on plotting multiple graphs(from different dozen of file.dat) in a single Canvas by using mg->add(“AL”).
I add all each time my points then I plot by mg->draw() . the problem is the final graph is just for last file. I tried to print the mg and it shows points of all files. but still, the final graph is for a single file.
Thanks
I have generate one mg after adding all gr . yes, I have checked the files(about 50) they are slightly different with a margin of the discrepancy of 0.1 to 0.005.
TMultiGraph *mg = new ...; // create the multigraph
for (...) { // loop over all files
// open the "current" file then ...
TGraph *gr = …; // retrieve or create the graph
mg->Add(gr);
// ... close the "current" file
}
mg->Draw("APL");
okay, the structure sames almost same but when I changed the Draw line to from AL to APL it gives out thin red line (as I got it before ) with black wide line overlapped this time .