Good day to you!
I'm trying to draw lines on my QwtPlot graph, and using this construction:
Qt Code:
  1. ui_plot->setAutoFillBackground(true);
  2. ui_plot->setCanvasBackground(QColor(0xE3E3E3));
  3. ui_plot->setAxisScale(QwtPlot::yLeft, -1, 1);
  4. ui_plot->setAxisScale(QwtPlot::xBottom, -1, 1);
  5. ui_plot->enableAxis(QwtPlot::yLeft, true);
  6. ui_plot->enableAxis(QwtPlot::xBottom, true);
  7. QwtPlotCurve *xline = new QwtPlotCurve();
  8. QwtPlotCurve *yline = new QwtPlotCurve();
  9.  
  10. double x[3] ={-1.0, 0.0, 1.0};
  11. double y[3] ={0,0,0};
  12.  
  13. xline->setData(new QwtCPointerData(x,y,(size_t)3));
  14. xline->setPen(QPen(QColor(Qt::black)));
  15. xline->attach(ui_plot);
  16. ui_plot->replot();
To copy to clipboard, switch view to plain text mode 

I expect to have line, drawn from -1 to 1. But for some reason i always receive line from 0 to +∞. It's weird and i really want to know, what kind of data i should use to draw a simple x[-1;0;1] y[0;0;0] line. Can you help me please?