How to superimpose three TGraphs in one TCanvas?

Hi,
I am using version 5.17/5 (ready compiled for Ubuntu). I am quite new to root and this forum, and so my question might be a bit stupid, but I am having problems with superimposing three TGraphs that I have made. I am trying to do it the following way, but only one of the graphs show up (the scale is in the same range for all three):

gr1->SetLineColor(4);
gr1->SetTitle(“Kinematics”);
gr1->GetYaxis()->SetTitleOffset(2.5);
gr1->GetYaxis()->CenterTitle();
gr1->GetYaxis()->SetTitle(“Kinetic energy of ejectile [MeV]”);
gr1->GetXaxis()->CenterTitle();
gr1->GetXaxis()->SetTitle("Lab angle [degrees] ");
gr1->Draw(“AL”);
gr2->SetLineColor(3);
gr2->Draw(“L”);
gr3->SetLineColor(5);
gr3->Draw(“L”);

I thought leaving out the axis option (“A”) should do it, but it does not work. Did I miss out on something, or do I really need to use the long way around with transparent pads?

The way you proceed is fine as soon as the first graph has its scales along X and Y axis larger than the scales of the two other graphs. If it is not the case, the two other graphs will not be visible. To compute a common scale among several graphs, ROOT provides the TMultiGraph class. See:
root.cern.ch/root/html/TMultiGraph.html

and also:

$ROOTSYS/tutorials/graphs/multigraph.C

Thanks for answering quickly, I’ll try with TMultiGraph then :slight_smile: