0

I have a QwtPlot. This plot is autoscalable but I would like to limit the distention to avoid that my plot be extended only between 46.5 and 47.5. I would for example, that my plot wasn't extented on less of 5 unites.

I know I must use QwtScaleEngine but I don't how ?

artoon
  • 729
  • 2
  • 14
  • 41

1 Answers1

0

Seems, that you have no need to use QwtScaleEngine try this kind of code:

plot=new QwtPlot(parent);
plot->setAxisAutoScale(QwtPlot::yLeft,false);
plot->setAxisScale(QwtPlot::yLeft,minYBorder,maxYBorder,0);

QwtScaleEngine is better in use for formatting like:

class TimeScaleDraw:public QwtScaleDraw{
public:
    TimeScaleDraw(QString fmt):format(fmt){}
    virtual         QwtText label(double v) const{
    return (QDateTime::fromMSecsSinceEpoch(floor(v))).toString(format);    }
private:
    const           QString format;
};
AlexBee
  • 368
  • 3
  • 13