Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
hist031_TRatioPlot_residual_fit.py
2## \ingroup tutorial_hist
3## \notebook
4## Example which shows how you can get the graph of the lower plot and set the y axis range for it.
5##
6## Since the lower plot is not created until `TRatioPlot::Draw` is called, you can only use the method
7## afterwards.
8## Inspired by the tutorial of Paul Gessinger.
9##
10## \macro_image
11## \macro_code
12##
13## \author Alberto Ferro
14
15import ROOT
16
18c1 = ROOT.TCanvas("c1", "fit residual simple")
20
21h1 = ROOT.TH1D("h1", "h1", 50, -5, 5)
22h1.FillRandom("gaus", 2000)
23h1.Fit("gaus")
24h1.SetMinimum(0.001)
25h1.GetXaxis().SetTitle("x")
26h1.GetYaxis().SetTitle("y")
27
28rp1 = ROOT.TRatioPlot(h1)
30rp1.GetLowerRefGraph().SetMinimum(-2)
31rp1.GetLowerRefGraph().SetMaximum(2)
32
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.