23CPol = ROOT.TCanvas(
"CPol",
"TGraphPolar Examples", 1200, 600)
37fplot = ROOT.TF1(
"fplot",
"cos(2*x)*cos(20*x)", xmin, xmax)
38for ipt
in range(1000):
39 x = np.append(x, ipt * (xmax - xmin) / 1000 + xmin)
40 y = np.append(y, fplot.Eval(x[ipt]))
42grP = ROOT.TGraphPolar(1000, x, y)
51 xval1 = np.append(xval1, x[math.floor(1000 / 20 * ipt)])
52 yval1 = np.append(yval1, y[math.floor(1000 / 20 * ipt)])
54grP1 = ROOT.TGraphPolar(20, xval1, yval1)
55grP1.SetMarkerStyle(29)
64if grP1.GetPolargram():
66 grP1.GetPolargram().SetRangePolar(-math.pi, math.pi)
67 grP1.GetPolargram().SetNdivPolar(703)
68 grP1.GetPolargram().SetToRadian()
78 x2 = np.append(x2, x[math.floor(1000 / 30 * ipt)])
79 y2 = np.append(y2, 1.2 + 0.4 * math.sin(math.pi * 2 * ipt / 30))
80 ex = np.append(ex, 0.2 + 0.1 * math.cos(2 * math.pi / 30 * ipt))
81 ey = np.append(ey, 0.2)
84grPE = ROOT.TGraphPolar(30, x2, y2, ex, ey)
85grPE.SetMarkerStyle(22)
86grPE.SetMarkerSize(1.5)
95if grPE.GetPolargram():
97 grPE.GetPolargram().SetTwoPi()
98 grPE.GetPolargram().SetToRadian()