int main(int argc, char *argv[])
{
plot.setCanvasBackground( Qt::white );
plot.
enableAxis(QwtPlot::xBottom,
false);
plot.
enableAxis(QwtPlot::xTop,
true);
plot.
setAxisScale( QwtPlot::yLeft,
0.0,
10.0 );
plot.
setAxisScale( QwtPlot::xTop,
0.0,
10.0 );
curve->setPen( Qt::blue );
curve
->setRenderHint
( QwtPlotItem::RenderAntialiased,
true );
curve->setSamples( points );
curve->attach(&plot);
plot.resize( 600, 400 );
plot.show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QwtPlot plot;
plot.setCanvasBackground( Qt::white );
plot.enableAxis(QwtPlot::xBottom,false);
plot.enableAxis(QwtPlot::xTop,true);
plot.setAxisScale( QwtPlot::yLeft, 0.0, 10.0 );
plot.setAxisScale( QwtPlot::xTop, 0.0, 10.0 );
QwtPlotCurve *curve= new QwtPlotCurve();
curve->setPen( Qt::blue );
curve->setRenderHint( QwtPlotItem::RenderAntialiased, true );
QPolygonF points;
points << QPointF( 0.0, 4.4 ) << QPointF( 1.0, 3.0 )
<< QPointF( 2.0, 4.5 ) << QPointF( 3.0, 6.8 )
<< QPointF( 4.0, 7.9 ) << QPointF( 5.0, 7.1 );
curve->setSamples( points );
curve->attach(&plot);
plot.resize( 600, 400 );
plot.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks