13from ROOT
import TF1, TCanvas, TSystem, TAxis, TLegend
14from ROOT
import kRed, kGreen, kBlue
17pdfunc =
TF1(
"pdf",
"ROOT::Math::normal_pdf(x, [0],[1])", -5, 5)
18cdfunc =
TF1(
"cdf",
"ROOT::Math::normal_cdf(x, [0],[1])", -5, 5)
19ccdfunc =
TF1(
"cdf_c",
"ROOT::Math::normal_cdf_c(x, [0])", -5, 5)
20qfunc =
TF1(
"quantile",
"ROOT::Math::normal_quantile(x, [0])", 0, 1)
21cqfunc =
TF1(
"quantile_c",
"ROOT::Math::normal_quantile_c(x, [0])", 0, 1)
25pdfunc.SetParameters(1.0, 0.0)
27pdfunc.SetLineColor(kBlue)
30Xaxis = pdfunc.GetXaxis()
31Yaxis = pdfunc.GetYaxis()
32Xaxis.SetLabelSize(0.06)
34Xaxis.SetTitleSize(0.07)
35Xaxis.SetTitleOffset(0.55)
36Yaxis.SetLabelSize(0.06)
40cdfunc.SetParameters(1.0, 0.0)
42cdfunc.SetLineColor(kRed)
46cdXaxis = cdfunc.GetXaxis()
47cdYaxis = cdfunc.GetYaxis()
48cdXaxis.SetLabelSize(0.06)
50cdXaxis.SetTitleSize(0.07)
51cdXaxis.SetTitleOffset(0.55)
52cdYaxis.SetLabelSize(0.06)
54cdYaxis.SetTitleSize(0.07)
55cdYaxis.SetTitleOffset(0.55)
59ccdfunc.SetParameters(1.0, 0.0)
61ccdfunc.SetLineColor(kGreen)
65qfunc.SetParameter(0, 1.0)
67qfunc.SetLineColor(kRed)
71qfXaxis = qfunc.GetXaxis()
72qfYaxis = qfunc.GetYaxis()
73qfXaxis.SetLabelSize(0.06)
75qfYaxis.SetLabelSize(0.06)
76qfXaxis.SetTitleSize(0.07)
77qfXaxis.SetTitleOffset(0.55)
79qfYaxis.SetTitleSize(0.07)
80qfYaxis.SetTitleOffset(0.55)
84cqfunc.SetParameter(0, 1.0)
86cqfunc.SetLineColor(kGreen)
90c1 =
TCanvas(
"c1",
"Normal Distributions", 100, 10, 600, 800)
96legend1 =
TLegend(0.583893, 0.601973, 0.885221, 0.854151)
97legend1.AddEntry(pdfunc,
"normal_pdf",
"l")
104legend2 =
TLegend(0.585605, 0.462794, 0.886933, 0.710837)
105legend2.AddEntry(cdfunc,
"normal_cdf",
"l")
106legend2.AddEntry(ccdfunc,
"normal_cdf_c",
"l")
113legend3 =
TLegend(0.315094, 0.633668, 0.695179, 0.881711)
114legend3.AddEntry(qfunc,
"normal_quantile",
"l")
115legend3.AddEntry(cqfunc,
"normal_quantile_c",
"l")
This class displays a legend box (TPaveText) containing several legend entries.