forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathcoreStatFunc.py
More file actions
39 lines (35 loc) · 904 Bytes
/
mathcoreStatFunc.py
File metadata and controls
39 lines (35 loc) · 904 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## \file
## \ingroup tutorial_math
## \notebook
## Example macro showing some major probability density functions in ROOT.
## The macro shows four of them with
## respect to their two variables. In order to run the macro type:
##
## ~~~{.cpp}
## root [0] .x mathcoreStatFunc.C
## ~~~
##
## Original tutorial by Andras Zsenei.
## \macro_image
## \macro_code
##
## \author Alberto Ferro
import ROOT
f1a = ROOT.TF2("f1a","ROOT::Math::cauchy_pdf(x, y)",0,10,0,10)
f2a = ROOT.TF2("f2a","ROOT::Math::chisquared_pdf(x,y)",0,20, 0,20)
f3a = ROOT.TF2("f3a","ROOT::Math::gaussian_pdf(x,y)",0,10,0,5)
f4a = ROOT.TF2("f4a","ROOT::Math::tdistribution_pdf(x,y)",0,10,0,5)
c1 = ROOT.TCanvas("c1","c1",800,650)
c1.Divide(2,2)
c1.cd(1)
f1a.SetLineWidth(1)
f1a.Draw("surf1")
c1.cd(2)
f2a.SetLineWidth(1)
f2a.Draw("surf1")
c1.cd(3)
f3a.SetLineWidth(1)
f3a.Draw("surf1")
c1.cd(4)
f4a.SetLineWidth(1)
f4a.Draw("surf1")