plot icon indicating copy to clipboard operation
plot copied to clipboard

Docs on plotutil functions should describe behavior on multiple calls

Open eaburns opened this issue 10 years ago • 2 comments

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.

eaburns avatar Mar 17 '15 10:03 eaburns

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)
    }

hiszpanski avatar Sep 18 '19 06:09 hiszpanski

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.

eaburns avatar Sep 18 '19 10:09 eaburns