Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Extra QPen plot when doing realtime plot in qcustomplot. how to remove it .
Forum Updated to NodeBB v4.3 + New Features

Extra QPen plot when doing realtime plot in qcustomplot. how to remove it .

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 115 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Ramkumar MohanR Offline
    Ramkumar MohanR Offline
    Ramkumar Mohan
    wrote on last edited by Ramkumar Mohan
    #1

    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();
    

    8c393bd4-90a0-4853-9f30-0b44d9de6b16-image.png

    give me any suggestion,

    thank you

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved