I would like to superimpose a histogram over another bigger one in the same canvas (see attachment). The problem is that I need to do it from the command line. I have managed to add the extra pad but I cannot draw the 2nd histogram in it. Is there some kind of a command line example for this?
The cd() command does not work for me. The 2nd histogram is drawn on the canvas and not in the pad. I think I must somehow activate the pad. Here is my code (the two histograms are: fPt and fEta):
TCanvas* c11 = new TCanvas("c11","c11");
c11->cd();
fEta->Draw();
TPad* p11 = new TPad("p11","p11", 0.25,0.3,0.6,0.7);
p11->cd();
fPt->Draw();
p11->Update();
c11->Update();
Try:TCanvas* c11 = new TCanvas("c11","c11");
c11->cd();
fEta->Draw();
TPad* p11 = new TPad("p11","p11", 0.25,0.3,0.6,0.7);
p11->Draw();
p11->cd();
fPt->Draw();
p11->Update();
c11->Update();[quote]Is there some kind of a command line example for this?[/quote]The picture seems to indicate you somehow succeeded (at least via the gui), if this is the case, you can then use the file item File/Save/c1.C which will create a file named c1.C which contains the C++ code to reproduce the canvas.