In [ ]:
import (
    "os"
    "path/filepath"
    
    "go-hep.org/x/hep/hbook/rootcnv"
    "go-hep.org/x/hep/rootio"
)
In [ ]:
fname := filepath.Join(os.Getenv("GOPATH"), "src", "go-hep.org/x/hep/rootio/testdata/graphs.root")
f, err := rootio.Open(fname)
if err != nil {
    panic(err)
}
defer f.Close()
In [ ]:
printf("keys: %v\n", f.Keys())
In [ ]:
obj, err := f.Get("tge")
if err != nil {
    panic(err)
}
In [ ]:
s2, err := rootcnv.S2D(obj.(rootio.Graph))
if err != nil {
    panic(err)
}
In [ ]:
import (
    "image/color"
    "go-hep.org/x/hep/hplot"
)
In [ ]:
p := hplot.New()
p.Title.Text = "Graph"
h := hplot.NewS2D(s2, hplot.WithYErrBars)
h.Color = color.RGBA{R:0xff, A:0xff}
p.Add(h)
p.Add(hplot.NewGrid())
In [ ]:
hplot.Show(p, 640, -1, "png")