12from ROOT
import TCanvas, TPad, TFile, TPaveLabel, TPaveText
15c1 =
TCanvas(
'c1',
'Histogram Drawing Options', 200, 10, 700, 900 )
17pad1 =
TPad(
'pad1',
'The pad with the function', 0.03, 0.62, 0.50, 0.92, 21 )
18pad2 =
TPad(
'pad2',
'The pad with the histogram', 0.51, 0.62, 0.98, 0.92, 21 )
19pad3 =
TPad(
'pad3',
'The pad with the histogram', 0.03, 0.02, 0.97, 0.57, 21 )
26example =
TFile(
'py-hsimple.root' )
31 'Drawing options for one dimensional histograms' )
32title.SetFillColor( 16 )
33title.SetTextFont( 52 )
39hpx = gROOT.FindObject(
'hpx' )
42label1 =
TPaveLabel( -3.5, 700, -1, 800,
'Default option' )
43label1.SetFillColor( 42 )
49hpx.DrawCopy(
'lego1' )
50label2 =
TPaveLabel( -0.72, 0.74, -0.22, 0.88,
'option Lego1' )
51label2.SetFillColor( 42 )
53label2a =
TPaveLabel( -0.93, -1.08, 0.25, -0.92,
'Click on lego to rotate' )
54label2a.SetFillColor( 42 )
62hpx.SetMarkerStyle( 21 )
64label3 =
TPaveLabel( 2, 600, 3.5, 650,
'option e1p' )
65label3.SetFillColor( 42 )
72pave.SetFillColor( 42 )
73t1 = pave.AddText(
'You can move' )
76pave.AddText(
'Title and Stats pads' )
77pave.AddText(
'X and Y axis' )
78pave.AddText(
'You can modify bin contents' )
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
The most important graphics class in the ROOT system.
A Pave (see TPave) with a text centered in the Pave.
A Pave (see TPave) with text, lines or/and boxes inside.