Fill a TGraph using RDataFrame.
Author: Enrico Guiraud, Danilo Piparo (CERN), Massimo Tumolo (Politecnico di Torino)
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Monday, March 27, 2023 at 09:46 AM.
import ROOT
ROOT.ROOT.EnableImplicitMT(2)
d = ROOT.RDataFrame(160)
Welcome to JupyROOT 6.29/01
Create a trivial parabola
dd = d.Alias("x", "rdfentry_").Define("y", "x*x")
graph = dd.Graph("x", "y")
This tutorial is ran with multithreading enabled. The order in which points are inserted is not known, so to have a meaningful representation points are sorted.
c = ROOT.TCanvas()
graph.Sort()
graph.Draw("APL")
c.SaveAs("df021_createTGraph.png")
print("Saved figure to df021_createTGraph.png")
Saved figure to df021_createTGraph.png
Info in <TCanvas::Print>: png file df021_createTGraph.png has been created
Draw all canvases
from ROOT import gROOT
gROOT.GetListOfCanvases().Draw()