On Sun, 2014-02-02 at 15:46 -0800, Ethan Burns wrote:
> Hi Dan,
>
> I'm not sure that I understand. Do you mean that you expected each line to
> have a different color from its corresponding points or something else? If
> that is what you are asking, I don't have a particularly good reason. I
> tend to make plots where the points have the same color as their lines.
No. The issue is that this (from the wiki):
err = plotutil.AddLinePoints(p,
"First", randomPoints(15),
"Second", randomPoints(15),
"Third", randomPoints(15))
if err != nil {
panic(err)
}
gives a different result to this:
for _, ds := range []struct {
string
plotter.XYs
}{
{"First", randomPoints(15)},
{"Second", randomPoints(15)},
{"Third", randomPoints(15)},
} {
err = plotutil.AddLinePoints(p, ds.string, ds.XYs)
if err != nil {
panic(err)
}
}
The second looks more convoluted, but makes more sense than having to
store temporarily the name and data series until the end of an analysis
and then dump it all to the plot as one variadic argument.
> Perhaps there is some argument that it is easier to associate a point with
> a line of the same color; or maybe one could argue that coloring lines the
> same as their points requires fewer colors (one color for each <line,
> point> set instead of one color for each line and a whole new batch of
> colors for each set of points), but I guess it's mostly a subjective
> preference. For now, if you want different colors for lines and their
> respective points, you will have to do it yourself (its not too hard, but I
> understand why you'd prefer to just have plotutil behave the way you like).
>
> If you submit a feature request then I'll try to think up an easy and clean
> way to fit both options into the same interface, but nothing great comes to
> mind at the moment (I don't like adding a boolean argument to the function,
> nor do I want to provide two different functions). Do you have any ideas?
The change I was thinking of requires that a plot.Plot is able to return
how many series it has already. This may not be something that you want
to add.
>
> Ethan