18c1 = ROOT.TCanvas(
"c1",
"Two simple graphs", 200, 10, 700, 500)
27x = np.linspace(0, n - 1, n)
28y = 10 * np.sin(x + 0.2)
30gr1 = ROOT.TGraph(n, x, y)
38gr1.SetTitle(
"Graph from available data")
39gr1.GetXaxis().SetTitle(
"X title")
40gr1.GetYaxis().SetTitle(
"Y title")
58with open(f
"{ROOT.gROOT.GetTutorialDir()}/visualisation/graphs/data_basic.txt")
as file:
60 w_str, z_str = re.split(
r"\s+", line)[:2]
61 w = np.append(w, float(w_str))
62 z = np.append(z, float(z_str))
66gr2 = ROOT.TGraph(m, w, z)
71gr2.SetTitle(
"Graph from data file")
72gr2.GetXaxis().SetTitle(
"W title")
73gr2.GetYaxis().SetTitle(
"Z title")