From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2007-06-13 12:34:17
> For those who have put time or energy into making suggestions for the
> SVG_Plot program, an update (with pretty pictures!) is on the wiki:
> Feedback / use cases welcome ;).
From your example on the wiki:
my_plot << image_size(500, 200) << x_scale(-7, 9) << draw_axis()
<< plot_range(data1.begin(), data1.end(), blue)
<< plot_range(data2.begin(), data2.end(), green)
I would suggest:
- I don't think that operator overloading of << adds enough to be justified.
- Large numbers of constructor parameters are confusing unless you use
named parameters, which are themselves sufficiently unusual that they
are non-intuitive. I suggest avoiding constructor parameters when
possible and using e.g. set_* methods instead.
- Make it possible to plot an entire container more simply than
specifying both begin and end iterators.
If you feel the need to make the style more compact, it should be
possible to return a reference to the plot and chain methods like this:
- though I haven't tried to do this recently, so maybe I have forgotten
You might like to look at how GIL specifies colours, to see if there is
anything that you can re-use. At least, you should make sure that you
don't implement something that is similar-but-not-quite-the-same for
The results look great, by the way. I was doing something with Gnuplot
the other night that would have benefited from something like this:
I think that a simple wrapper program around your library that can read
and plot CSV files would be most useful.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk