hello every one ,
i have data in ntuple and i want to draw them in the same graph.
i wrote in the macro :
ntuple->Draw(“a:x”);
it works but i want to draw also b:x , c:x , d:x …
i tried
ntuple->Draw(“b:x”,“same”);
but it doesn’t work !!
Another option is to loop over all variables, get the maximum and minimum, and drawing a blank TH2F first with the right range and then drawing everything on top. This might be easier programmatically than trying to figure out which pair to draw first.
You could also try (but then the minimal value of the y-axis may be too high):
ntuple->Draw(“max(max(max(a, b), c), d):x”, “”, “axis”);
ntuple->Draw(“a:x”, “”, “same”);
ntuple->Draw(“b:x”, “”, “same”);
ntuple->Draw(“c:x”, “”, “same”);
ntuple->Draw(“d:x”, “”, “same”);
[quote=“Pepe Le Pew”]You could also try (but then the minimal value of the y-axis may be too high):
ntuple->Draw(“max(max(max(a, b), c), d):x”, “”, “axis”);
ntuple->Draw(“a:x”, “”, “same”);
ntuple->Draw(“b:x”, “”, “same”);
ntuple->Draw(“c:x”, “”, “same”);
ntuple->Draw(“d:x”, “”, “same”);[/quote]
I think it’s pretty clear that this doesn’t scale well. (Go ahead and write it up for 20 variables ).