{ //__________________________________________________________________________________________ // // Example to draw 2 histos in one canvas with common Xaxis (e.e. clued together // The 2 subpads are placed such that the lower Xaxis of the upper histo coincides // with the upper Xaxis of the lower (default margin in pad is .0025) // The upper pad is made transparent // // Author: Otto.Schaile@Physik.Uni-Muenchen.DE //______________________________________________________________________________________ gROOT->Reset(); TCanvas c1("c1","multipads",700,700); gStyle->SetPadBorderMode(0); gStyle->SetFrameBorderMode(0); Float_t small = 1e-7; // c1.Divide(1,2,small,small); gStyle->SetOptTitle(0); TPad p1("p1", "p1", 0, 0, 1, 0.5); p1->Draw(); c1->cd(); TPad p2("p2", "p2", 0, 0.45, 1, 0.95); p2->SetFillStyle(4000); p2->Draw(); TH1F h1("h1","test1",40,-4,4); TH1F h2("h2","test2",40,-4,4); // h2->GetXaxis()->SetNdivisions(0); h2->SetLabelOffset(10000); h1.FillRandom("gaus",1000); h2.FillRandom("gaus",10000); p1.cd(); gPad->SetTopMargin(small); gPad->SetTickx(-1); h1.Draw(); p2.cd(); gPad->SetTopMargin(small); h2.Draw(); }