2d placeholder for graphs

Hi, can someone please help me with how to make a 2D placeholder? I have several TGraphs, and I need to compare them all together in one graph, but they have different dimensions, and a placeholder would solve that problem. Thanks

Hi,
you can just create a TH2D and draw it and use it as a placeholder.

TH2D *h_placeholder=new TH2D("placeholder","your title",200, xmin,xmax,200,ymin,ymax);
h_placeholder->Draw();

Then you can draw all your graphs with the same option.

gr_1->Draw("PLsame")
...
gr_n->Draw("PLsame")

Stefano

Thank you so much!

There is NO “same” graphs’ drawing option.

To draw several graphs on the same plot and be sure all the graphs are visible, the best is to use TMultigraph. If you first draw a frame (by the way it is simpler to use DrawFrame than creating an empty histogram) and draw the graphs on top (without option SAME which does not exist for graphs) you may miss some parts of the graphs if they are outside the limits imposed by the frame.

1 Like

Thank you