Logo ROOT  
Reference Guide
zones.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_graphs
3## \notebook
4## Example of script showing how to divide a canvas
5## into adjacent subpads + axis labels on the top and right side
6## of the pads. Original tutorial by Rene Brun.
7##
8## \macro_image
9## \macro_code
10##
11## \author Alberto Ferro
12
13import ROOT
14
15c1 = ROOT.TCanvas("c1","multipads",900,700)
16ROOT.gStyle.SetOptStat(0)
17
18c1.Divide(2,2,0,0)
19h1 = ROOT.TH2F("h1","test1",10,0,1,20,0,20)
20h2 = ROOT.TH2F("h2","test2",10,0,1,20,0,100)
21h3 = ROOT.TH2F("h3","test3",10,0,1,20,-1,1)
22h4 = ROOT.TH2F("h4","test4",10,0,1,20,0,1000)
23
24c1.cd(1)
25ROOT.gPad.SetTickx(2)
26h1.Draw()
27c1.cd(2)
28ROOT.gPad.SetTickx(2)
29ROOT.gPad.SetTicky(2)
30h2.GetYaxis().SetLabelOffset(0.01)
31h2.Draw()
32c1.cd(3)
33h3.Draw()
34c1.cd(4)
35ROOT.gPad.SetTicky(2)
36h4.Draw()
37