--
You received this message because you are subscribed to the Google Groups "gonum-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gonum-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
We're almost six months late on delivering an API stability promise for plot, so I'd like to focus on getting that done before we embark on something of this scale.
I know I haven’t contributed much to the development of plot, so sorry if this is just complaining.Here’s the short list of things I would change:1) In most of my data, I have a particular set of x values, and several different sets of y values to plot. plotter.XYs is a []struct{X,Y}, so this means that for each data set I have to write code that transforms the {[]float64, []float64} into []struct{X,Y}. It’s not hard, but it’s tedious and I have to do it every time I want to write a plotting script.
2) In addition, since plotter.XYs is defined as a slice type, it’s annoying to use if you don’t know before hand exactly how many points you’ll need. One has to do something like pts = append(pts, struct{X,Y int}{a,b}). This comes up, for example, if you only want to plot points that meet a certain criteria.
Exposing such an interface seems like a nice idea. It would be especially great if your work on gonotebok pays off.Scripting languages are nice (in this context) for two reasons. First, they store the data after running so you can plot new things you didn’t previously know you wanted to see. Secondly, they typically making quick plots super easy. In matlab, it’s super quick to get a plot using plot(x,y), and maybe with a “hold all” to do some different lines.In my personal opinion, we could go a long way to making gonum/plot easier on this second front without having to leave go (or it’s standard compile/run style). This would be done through changing the interfaces and signatures in plotter and plotutil, and possibly adding an “easyplot” package or something for dealing with quick scripts. gonum/plot is great for making nice plots (way better than matlab for changing the way things look), but I haven’t found it to be particularly fun to try and script a bunch of plots.I know I haven’t contributed much to the development of plot, so sorry if this is just complaining.Here’s the short list of things I would change:1) In most of my data, I have a particular set of x values, and several different sets of y values to plot. plotter.XYs is a []struct{X,Y}, so this means that for each data set I have to write code that transforms the {[]float64, []float64} into []struct{X,Y}. It’s not hard, but it’s tedious and I have to do it every time I want to write a plotting script.2) In addition, since plotter.XYs is defined as a slice type, it’s annoying to use if you don’t know before hand exactly how many points you’ll need. One has to do something like pts = append(pts, struct{X,Y int}{a,b}). This comes up, for example, if you only want to plot points that meet a certain criteria.3) The plotutil routines look nice in the examples, but I basically never use them in practice. Frequently I’m writing code that is not plotting a static number of lines. It’s generally easier to add them one by one to the plot (including to the legend), then to try and use plotutil.AddLines (or whatever)I would love it if I could do// x []float64, y *mat64.Dense, names []stringp, err := easyplot.Lines(x, y, names) // added to the legend if names != nil, not otherwisep.X.Label.Text = “Independent Variable”p.Y.Label.Text = “Dependent Variable”_ = p.Save(4*vg.Inch, 4*vg.Inch, “myfile.pdf”)I feel like this is the idea behind plotutil, but it doesn’t seem to match what I usually want.Sorry if that was off-topic. Let me know if some of those fixes could match the recent improvements to plot you all have been making, and if I should file issues.