PDA

View Full Version : Weird QwtPlotCurve Behaviour



yannwilfried
18th July 2013, 08:10
Hello readers,

I'm plotting a frequency response on a QwtPlot setting the data by calling void QwtPlotCurve::setSamples(const QVector< double > & xData, const QVector< double > & yData) (http://qwt.sourceforge.net/class_qwt_plot_curve.html#a1e6e9a417479e372197b746 538fae47c). I'm just wondering why Qwt always draw a line from the minimum y-value to the first point in my dataset (see attached picture). I printed my QVectors on the console and can definitely confirm that the first point in my dataset is right.

I'm coding on a Windows 7 64-Bit machine with Qt 4.8.3 and Qwt 6.1.0.

Cheers,
Yann

Uwe
18th July 2013, 08:37
I'm just wondering why Qwt always draw a line from the minimum y-value to the first point in my dataset (see attached picture).
I does not.


I printed my QVectors on the console and can definitely confirm that the first point in my dataset is right.
Nevertheless I expect to find the reason in your dataset.

Uwe

yannwilfried
18th July 2013, 16:02
Thanks Uwe for your reply. It was indeed my bad. One has to be careful when playing around with pointers to the data stored in the QVector.