More than one graph in a Canvas

Greetings root users,

Could any one kindly help me and say how I can have different graphs in a single Canvas, in order to be able to compare them and label them?

Thnak you in advance

Create a TCanvas and divide it into Pads using the TCanvas::Divide() method, for instance if plot1 and plot2 are two TGraph graphics and histo is a TH1 histogram write:

TCanvas *cvs = new TCanvas("cvs","A title...");
cvs->Divide(2,2);
cvs->cd(1);
.....
.....   // options
plot1->Draw();

cvs->cd(2);
.....
.....
plot2->Draw();

cvs->cd(3);
.....
.....
histo->Draw();

Hej Again,

I felt I’d better attach my files for a better reference. each file contain three histograms. but I want to compare all the number 2s for example.

Many thanks again
essai3.root (9.13 KB)
essai2.root (9.74 KB)
essai1.root (9.78 KB)

Hi,

What did you try? How did it fail?

Philippe.

Philippe,

I think you can ignore this post. I have already answered this question (and many more !) here:

Olivier