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.
4 ROOT.gStyle.SetOptStat(0)
6 c1 = ROOT.TCanvas(
"c1",
"fit residual simple")
7 ROOT.gPad.SetFrameFillStyle(0)
9 h1 = ROOT.TH1D(
"h1",
"h1", 50, -5, 5)
10 h1.FillRandom(
"gaus", 5000)
14 h1.GetXaxis().SetTitle(
"x")
15 h1.GetYaxis().SetTitle(
"y")
17 rp1 = ROOT.TRatioPlot(h1,
"errfunc")
18 rp1.SetGraphDrawOpt(
"L")
19 rp1.SetSeparationMargin(0.0)
21 rp1.GetLowerRefGraph().SetMinimum(-2)
22 rp1.GetLowerRefGraph().SetMaximum(2)
- Author
- Alberto Ferro
Definition in file ratioplot6.py.