PDA

View Full Version : axis autoscale: 2 user case scenarios



fatecasino
16th January 2011, 20:34
I want to add a curve, and after some calculations I want to add a second curve.
From this point let's consider 2 user case scenarios:

1. The axis scaling remains as it is (we can see fully the first curve) and only the points of the second curve which are contained in the current axis are plotted (even none if the second curve is in a "faraway" region)

2.The axis rescale in order to put both curves in the same plot.

How should I combine the axis scale functions in order to implement these user case scenarios?

Added after 1 35 minutes:

After a basic set up of this implementation I have managed so far:



attach first curve-correctly scaled
attach second curve - badly/not correctly scaled

d_stranz
19th January 2011, 02:11
What exactly do you expect the plot to do? Look at your two curves and decide all by itself what the axis scale should be?

Your application knows about the data that is in the two curves. So after you load the second curve, if its range is larger than the range for the first curve then you have to call QwtPlot::setAxisScale() (and setZoomBase() if you are using a zoomer) to expand the x and/or y axis ranges so all of both curves will be displayed.

The QwtPlot doesn't magically do it for you.