Get multiple graphs on the same canvas

Comb.C (1.1 KB)

Here I have multiple graphs from different root files. I want to plot these graphs on the same canvas including the data points. I also want to set title for graph. Can someone help me with this?

You can use canvas->Divide(), see for example this tutorial. In your case,for 5 zones, you could do canvas->Divide(3,2); to have 3 cols x 2 rows, or Divide(2,3) for 2x3.

I want them on top of other.

For that, add them to a TMultiGraph.

1 Like


you say you want your graphs on the same canvas, and yet you create 5 different canvases. Can you explain why?

Comb.C (1.2 KB)

Now here I just want to set the title of the graphs and X-axis and Y-axis titles.

It’s shown on the same page I linked above (mg->SetTitle...).

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.