Logo ROOT   6.14/05
Reference Guide
ratioplot5.py
Go to the documentation of this file.
1 ## \file
2 ## \ingroup tutorial_hist
3 ## \notebook
4 ## Example that shows how you can set the colors of the confidence interval bands by using
5 ## the method `TRatioPlot::SetConfidenceIntervalColors`.
6 ## Inspired by the tutorial of Paul Gessinger.
7 ##
8 ## \macro_image
9 ## \macro_code
10 ##
11 ## \author Alberto Ferro
12 
13 import ROOT
14 
15 ROOT.gStyle.SetOptStat(0)
16 
17 c1 = ROOT.TCanvas("c1", "fit residual simple")
18 h1 = ROOT.TH1D("h1", "h1", 50, -5, 5)
19 h1.FillRandom("gaus", 2000)
20 h1.Fit("gaus")
21 h1.GetXaxis().SetTitle("x")
22 h1.GetYaxis().SetTitle("y")
23 
24 rp1 = ROOT.TRatioPlot(h1)
25 rp1.SetConfidenceIntervalColors(ROOT.kBlue, ROOT.kRed)
26 rp1.Draw()
27 c1.Update()