Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2007-05-23 10:03:34


1 It seems nice to be able to create a one-stop visualisation of a
container, for example:

std::vector<double> my_data_structure;
// fill with my data...

my-graph << my_data_structure; //

But should the myriad of graph plotting *options* be set using operator <<

allowing them to be chained together thus

my_graph << line_color(black) << point_color(blue)
 << x_range(-10, 10) << y_range(0, 5)...;

as suggested by John Maddock (who has a most irritating habit of being right ;-)

or more conventional setter member functions

my_graph.line_color(black);
my_graph.point_color(blue);
my_graph.x_range(-10, 10);
my_graph.y_range(0, 5);

and could getter versions return their current values

if (my_graph.line_color() == black) ....

possibly chained (return this) to reduce typing?

http://www.parashift.com/c++-faq-lite/references.html#faq-8.4

my_graph.line_color(black).point_color(blue).x_range(-10, 10).y_range(0, 5);

2 How can a set of plot settings be 'saved' for repeated use? Once one has chosen a plot style, line_color black, point_color blue
..., one wants to save this for re-use (though things like the range may change).

3 Does anyone have experience with auto-axis scaling algorithms. The best reference I have found is Michael Bramley,
C/C++ Users journal, www.cuj.com July 2000, pp 20 - 26

But this does not always give the nicest scales - it would work nicely using decimal, but the damned binary FP *wrong* bits at the
end screw up the comparisons. (Excel plots show this behaviour).

Suggestions?

Paul

---
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
+44 1539561830 & SMS, Mobile +44 7714 330204 & SMS
pbristow_at_[hidden]
 

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk