Extra QPen plot when doing realtime plot in qcustomplot. how to remove it .
Unsolved
General and Desktop
-
Extra QPen plot when doing realtime plot in qcustomplot. how to remove it .
This is my code :
QVector<double> xv1(2); QVector<double> yv1(2); QVector<double> xv2(2); QVector<double> yv2(2); QVector<double> xv3(2); QVector<double> yv3(2); xv1[0]=xv1[1]=10; xv2[0]=xv2[1]=50; yv1[0]=yv2[0]=*std::min_element(qv_y.begin() , qv_y.end())-0.25; yv1[1]=yv2[1]=*std::max_element(qv_y.begin() , qv_y.end())+0.25; ui->customPlot->xAxis->setLabel("Time(S)"); ui->customPlot->yAxis->setLabel("Abs"); ui->customPlot->xAxis->setRange(10, 50); ui->customPlot->yAxis->setRange(*std::min_element(qv_y.begin() , qv_y.end())-0.25,*std::max_element(qv_y.begin() , qv_y.end())+0.25); ui->customPlot->update(); ui->customPlot->addGraph(); ui->customPlot->graph(1)->setPen(QPen(Qt::red,3)); ui->customPlot->graph(1)->setData(xv1,yv1); ui->customPlot->addGraph(); ui->customPlot->graph(2)->setPen(QPen(Qt::red,8)); ui->customPlot->graph(2)->setData(xv2,yv2); ui->customPlot->replot();
give me any suggestion,
thank you