Logo ROOT   6.12/06
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Namespaces
zones.py File Reference

Namespaces

 zones
 

Detailed Description

Example of script showing how to divide a canvas into adjacent subpads + axis labels on the top and right side of the pads.

Original tutorial by Rene Brun.

pict1_zones.py.png
1 
2 import ROOT
3 
4 c1 = ROOT.TCanvas("c1","multipads",900,700)
5 ROOT.gStyle.SetOptStat(0)
6 
7 c1.Divide(2,2,0,0)
8 h1 = ROOT.TH2F("h1","test1",10,0,1,20,0,20)
9 h2 = ROOT.TH2F("h2","test2",10,0,1,20,0,100)
10 h3 = ROOT.TH2F("h3","test3",10,0,1,20,-1,1)
11 h4 = ROOT.TH2F("h4","test4",10,0,1,20,0,1000)
12 
13 c1.cd(1)
14 ROOT.gPad.SetTickx(2)
15 h1.Draw()
16 c1.cd(2)
17 ROOT.gPad.SetTickx(2)
18 ROOT.gPad.SetTicky(2)
19 h2.GetYaxis().SetLabelOffset(0.01)
20 h2.Draw()
21 c1.cd(3)
22 h3.Draw()
23 c1.cd(4)
24 ROOT.gPad.SetTicky(2)
25 h4.Draw()
26 
Author
Alberto Ferro

Definition in file zones.py.