Hi all,
I am trying to add two TGraphs for each variable I loop over. I tried the following:
c=ROOT.TCanvas('c','c',500,500)
for var in variables:
['tgraph1_%s'%var].Draw('apc')
['tgraph2_%s'%var].Draw('SAME')
c.cd()
c.Modified()
c.Update()
c.SaveAs('test.png')
However, this adds all the graphs together, whereas I only want one graph (with two lines) for each variable. How can I do that?
I am not sure I fully understand you macro. In the loop you first draw a graph redefining the axes (option “a”) and then a graph on top (by the way "same: is not a graph option use “pc” instead). so at te end of the loop you should see only two graphs.
Thanks! This seems to work, but it seemst to adapt the scale to the first TGraph, so that the second one is not shown. How can I manually change the range?