【发布时间】:2024-01-06 11:58:01
【问题描述】:
我将QwtPlot 子类化为:
class RealPlot : public QwtPlot {
public:
RealPlot () {
...
setAxisScale(QwtPlot::xBottom, -5, 5);
}
void addPoint(Point p) {
...
setAxisScale(QwtPlot::xBottom, min, max);
}
}
而且我想在每次添加新点时重新调整(水平轴)绘图。所以我在点被添加到曲线之后就调用setAxisScale(QwtPlot::xBottom, min, max);。
问题是情节没有被重新调整。在构造函数中对setAxisScale(QwtPlot::xBottom, -5, 5); 的调用确实会重新缩放绘图。但是setAxisScale(QwtPlot::xBottom, min, max); 没有。为什么?
【问题讨论】: