Hello, in ROOT 6.06/04, I get the following problem.
If I open test.root and that I save the plots in C format, I get the test.C file.
If you run it, you see that the property of the TGraphs are not saved in the TLegend (everything is green in the .C file unlike what is within the .root file)
Secondly, why am I not able to use SetRangeUser for any value in the upper TPad? I mean, if I try to specify xmin=14 and xmax=900, xmax is modified but not xmin. Yet, it works if I specify, xmin=15 and xmax=900. Any explanation for that?
Yes … TLegend is lost because all the graphs have the same name “Graph”…
I Think if you name you graphs in the original macro you will avoid this problem
Secondly:
May be the the x axis is in log scale and has a negative xmin produces this effect. If I go back to linear I can zoom it
Ok for the first point. I guess it is not obvious to take into account this unnamed graphes during the C file creation. The idea is to produce a C file which is exactly what was plotted on the screen (as the root file does)
For the second point I am not sure to understand very well. Does it mean that the problem come from ROOT when log X-axis is used?
root -l test.root
c->Draw()
TPad *upper_pad = (TPad*)c->GetListOfPrimitives()->At(0)
TMultiGraph *g = (TMultiGraph*)upper_pad->GetListOfPrimitives()->At(1)
g->GetXaxis()->SetRangeUser(14,1000)
Click on the upper pad to see that the xmax is modified and that the xmin remains the same.
Click on the pad to see that the xmin is well modified.
And as you said before, it works well if I set the X-axis as linear (instead of log).