Boost logo

Boost :

From: Jake Voytko (jakevoytko_at_[hidden])
Date: 2007-07-31 14:31:12


On 7/31/07, Marco <mrcekets_at_[hidden]> wrote:
> (2) You define default for the x,y range as [-10, 10]. Shouldn't the
> default be guessed by the data values ?

Yes, but I'm finding that it's harder than it seems to pull this off
right. Picking a range that contains all / a majority of the axis is
relatively easy (scale axis to n standard deviations), but making the
ticks fall on "nice" numbers is a little harder. This is a goal for
this project, but is not my primary one for the time being. Also, the
user may want to have good control over the plot window, so I'm not
sure just how much guessing the header should do without being told to
do so. My philosophy has been to leave the lowest-common-denominator
as a default, and this would be something the user would specify

my_plot.auto_scale_x(true).y_range(-1, 15);

>
> (3) Instead of x_external_style_on you could use
> x_axis_alignment( alignment_type alignment ) where alignment is one from
> {center, top, bottom}, the default case would be alignment==center, while
> the bottom alignment would produce the same effect of
> x_external_style_on(true), and the top alignment would put the x axis
> ticks and values on the top of the window; similiarly for the y axis you
> could make use of a method y_axis_alignment( alignment_type alignment )
> with possible alignment values center, left and right.

That's a great idea! This will also allow me to easily change the
alignment of the axes for when the alignment is "center", but the axis
is not drawn within the plot window. The solution I've been sketching
out in my head was more of a brute-force attack, but it seems this
more elegantly solves the problem.

Thank you,
Jake


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