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