ui_plot->setAutoFillBackground(true);
ui_plot
->setCanvasBackground
(QColor(0xE3E3E3
));
ui_plot
->setAxisScale
(QwtPlot::yLeft,
-1,
1);
ui_plot
->setAxisScale
(QwtPlot::xBottom,
-1,
1);
ui_plot
->enableAxis
(QwtPlot::yLeft,
true);
ui_plot
->enableAxis
(QwtPlot::xBottom,
true);
double x[3] ={-1.0, 0.0, 1.0};
double y[3] ={0,0,0};
xline->attach(ui_plot);
ui_plot->replot();
ui_plot->setAutoFillBackground(true);
ui_plot->setCanvasBackground(QColor(0xE3E3E3));
ui_plot->setAxisScale(QwtPlot::yLeft, -1, 1);
ui_plot->setAxisScale(QwtPlot::xBottom, -1, 1);
ui_plot->enableAxis(QwtPlot::yLeft, true);
ui_plot->enableAxis(QwtPlot::xBottom, true);
QwtPlotCurve *xline = new QwtPlotCurve();
QwtPlotCurve *yline = new QwtPlotCurve();
double x[3] ={-1.0, 0.0, 1.0};
double y[3] ={0,0,0};
xline->setData(new QwtCPointerData(x,y,(size_t)3));
xline->setPen(QPen(QColor(Qt::black)));
xline->attach(ui_plot);
ui_plot->replot();
To copy to clipboard, switch view to plain text mode
Bookmarks