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

Namespaces

 ratioplot6
 

Detailed Description

Example showing a fit residual plot, where the separation margin has been set to 0.

The last label of the lower plot's y axis is hidden automatically. Inspired by the tutorial of Paul Gessinger.

pict1_ratioplot6.py.png
1 
2 import ROOT
3 
4 ROOT.gStyle.SetOptStat(0)
5 
6 c1 = ROOT.TCanvas("c1", "fit residual simple")
7 ROOT.gPad.SetFrameFillStyle(0)
8 
9 h1 = ROOT.TH1D("h1", "h1", 50, -5, 5)
10 h1.FillRandom("gaus", 5000)
11 h1.Fit("gaus", "S")
12 
13 h1.Sumw2()
14 h1.GetXaxis().SetTitle("x")
15 h1.GetYaxis().SetTitle("y")
16 
17 rp1 = ROOT.TRatioPlot(h1, "errfunc")
18 rp1.SetGraphDrawOpt("L")
19 rp1.SetSeparationMargin(0.0)
20 rp1.Draw()
21 rp1.GetLowerRefGraph().SetMinimum(-2)
22 rp1.GetLowerRefGraph().SetMaximum(2)
23 
24 c1.Update()
Author
Alberto Ferro

Definition in file ratioplot6.py.