QCustomPlot Discussion and Comments

yaxis data not plotted correctlyReturn to overview

Code:

        
        QVector<double> qvX,qvY;
        qvX.clear();
        qvY.clear();
        foreach(QString str, timeList) {
            qDebug() << "x" << str.toDouble();
            qvX.append(str.toDouble());
        }
        foreach(QString str, absList) {
            qDebug() << "y" << str.toDouble();
            qvY.append(str.toDouble());
        }
        ui->qwtPlot->addGraph();
        ui->qwtPlot->graph()->setData(qvX,qvY);
        ui->qwtPlot->replot();

Data input x and y is as below:
x 0
x 1
x 2
x 3
x 4
x 5
x 0
y 0.23888
y 0.23888
y 0.23888
y 0.23888
y 0.23888
y 0.23888
y 0

Graph output is as below (image url)
https://drive.google.com/open?id=0By3KWD9vzoweTEhLSjBJQnlkeXM

Porblem:
First point y=0.23888 is not plotted instead 0 is plotted. Please give solution.

so the first thing that is obvious to me is that you are using the graph type (which cannot wrap around) but have data that wraps. this would cause x at 0 to go back to the y at 0 value.

if you want the plot to wrap, you have to use the QCPCurve type.

@Ian thank you it worked by removing the last 0 value which was wrapping.