//create a plot
//create a curve
double x[] = {0,1,2,3,4,5,6,7,8,9,10};
double y[] = {1,2,3,2,1,0,1,2,3,2,1};;
curve.setRawSamples(x, y, 11);
curve.attach(&plot);
//create zoom
zoom.
setAxisEnabled(QwtPlot::xBottom,
true);
//set scale
plot.
setAxisScale(QwtPlot::xBottom,
0,
10,
1);
//show plot
plot.show();
//create a plot
QwtPlot plot;
//create a curve
QwtPlotCurve curve = QwtPlotCurve();
double x[] = {0,1,2,3,4,5,6,7,8,9,10};
double y[] = {1,2,3,2,1,0,1,2,3,2,1};;
curve.setRawSamples(x, y, 11);
curve.attach(&plot);
//create zoom
QwtPlotMagnifier zoom = QwtPlotMagnifier(plot.canvas());
zoom.setAxisEnabled(QwtPlot::xBottom,true);
//set scale
plot.setAxisScale(QwtPlot::xBottom,0,10,1);
//show plot
plot.show();
To copy to clipboard, switch view to plain text mode
Bookmarks