vendredi 22 juillet 2016

QwtPlot setAxisScale, how it works?

I subclassed QwtPlot like:

class RealPlot : public QwtPlot {
public:
    RealPlot () {
        ...
        setAxisScale(QwtPlot::xBottom, -5, 5);
    }
    void addPoint(Point p) {
        ...
        setAxisScale(QwtPlot::xBottom, min, max);
    }
}

And I would like to rescale the (horizontal axis of) plot every time a new point is added. So I call setAxisScale(QwtPlot::xBottom, min, max); just after the point is added to the curve.

The problem is that the plot is not being rescaled. The call to setAxisScale(QwtPlot::xBottom, -5, 5); in the constructor does rescale the plot. But setAxisScale(QwtPlot::xBottom, min, max); does not. Why?

Aucun commentaire:

Enregistrer un commentaire