plot
plot copied to clipboard
Docs on plotutil functions should describe behavior on multiple calls
Original issue 138 created by eaburns on 2014-02-03T00:24:33.000Z:
For example, each call to plotutil.AddLines will restart the color pallet. If you want to cycle through the colors, you have to add all lines in a single call.
Agree. I found it unintuitive that using the code below, only the last plot is visible:
p, _ := plot.New()
for i := 0; i < 5; i++ {
p.Add(plotter.NewFunction(func(x float64) float64 { return x + float64(i) }))
}
p.X.Min = -1
p.X.Max = 1
p.Y.Min = -10
p.Y.Max = 10
if err := p.Save(4*vg.Inch, 4*vg.Inch, "functions.png"); err != nil {
panic(err)
}
Looks like this is a slightly different issue. This bug is about the plotutil package specifically, but if I understand correctly, you are comment about the plot package's Plot.Save function. I think it's still a fair comment, however.