import (
"os"
"path/filepath"
"go-hep.org/x/hep/hbook/rootcnv"
"go-hep.org/x/hep/rootio"
)
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()
printf("keys: %v\n", f.Keys())
obj, err := f.Get("tge")
if err != nil {
panic(err)
}
s2, err := rootcnv.S2D(obj.(rootio.Graph))
if err != nil {
panic(err)
}
import (
"image/color"
"go-hep.org/x/hep/hplot"
)
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())
hplot.Show(p, 640, -1, "png")