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

Namespaces

 ratioplot3
 

Detailed Description

Example which shows how you can get the graph of the lower plot and set the y axis range for it.

Since the lower plot is not created until TRatioPlot::Draw is called, you can only use the method afterwards. Inspired by the tutorial of Paul Gessinger.

pict1_ratioplot3.py.png
1 
2 import ROOT
3 
4 ROOT.gStyle.SetOptStat(0)
5 c1 = ROOT.TCanvas("c1", "fit residual simple")
6 c1.SetLogy()
7 
8 h1 = ROOT.TH1D("h1", "h1", 50, -5, 5)
9 h1.FillRandom("gaus", 2000)
10 h1.Fit("gaus")
11 h1.SetMinimum(0.001)
12 h1.GetXaxis().SetTitle("x")
13 h1.GetYaxis().SetTitle("y")
14 
15 rp1 = ROOT.TRatioPlot(h1)
16 rp1.Draw()
17 rp1.GetLowerRefGraph().SetMinimum(-2)
18 rp1.GetLowerRefGraph().SetMaximum(2)
19 
20 c1.Update()
Author
Alberto Ferro

Definition in file ratioplot3.py.