ROOT
6.18/05
Reference Guide
tutorials
graphs
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
13
import
ROOT
14
15
c1 = ROOT.TCanvas(
"c1"
,
"multipads"
,900,700)
16
ROOT.gStyle.SetOptStat(0)
17
18
c1.Divide(2,2,0,0)
19
h1 = ROOT.TH2F(
"h1"
,
"test1"
,10,0,1,20,0,20)
20
h2 = ROOT.TH2F(
"h2"
,
"test2"
,10,0,1,20,0,100)
21
h3 = ROOT.TH2F(
"h3"
,
"test3"
,10,0,1,20,-1,1)
22
h4 = ROOT.TH2F(
"h4"
,
"test4"
,10,0,1,20,0,1000)
23
24
c1.cd(1)
25
ROOT.gPad.SetTickx(2)
26
h1.Draw()
27
c1.cd(2)
28
ROOT.gPad.SetTickx(2)
29
ROOT.gPad.SetTicky(2)
30
h2.GetYaxis().SetLabelOffset(0.01)
31
h2.Draw()
32
c1.cd(3)
33
h3.Draw()
34
c1.cd(4)
35
ROOT.gPad.SetTicky(2)
36
h4.Draw()
37