Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
mathcoreStatFunc.py
Go to the documentation of this file.
1## \file
2## \ingroup tutorial_math
3## \notebook
4## Example macro showing some major probability density functions in ROOT.
5## The macro shows four of them with
6## respect to their two variables. In order to run the macro type:
7##
8## ~~~{.cpp}
9## root [0] .x mathcoreStatFunc.C
10## ~~~
11##
12## Original tutorial by Andras Zsenei.
13## \macro_image
14## \macro_code
15##
16## \author Alberto Ferro
17
18import ROOT
19
20
21f1a = ROOT.TF2("f1a","ROOT::Math::cauchy_pdf(x, y)",0,10,0,10)
22f2a = ROOT.TF2("f2a","ROOT::Math::chisquared_pdf(x,y)",0,20, 0,20)
23f3a = ROOT.TF2("f3a","ROOT::Math::gaussian_pdf(x,y)",0,10,0,5)
24f4a = ROOT.TF2("f4a","ROOT::Math::tdistribution_pdf(x,y)",0,10,0,5)
25
26c1 = ROOT.TCanvas("c1","c1",800,650)
27c1.Divide(2,2)
28c1.cd(1)
29f1a.SetLineWidth(1)
30f1a.Draw("surf1")
31c1.cd(2)
32f2a.SetLineWidth(1)
33f2a.Draw("surf1")
34c1.cd(3)
35f3a.SetLineWidth(1)
36f3a.Draw("surf1")
37c1.cd(4)
38f4a.SetLineWidth(1)
39f4a.Draw("surf1")