Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to remove Extra QPen in my QCustomplot
Qt 6.12 LTS is out! See what's new in the release blog

How to remove Extra QPen in my QCustomplot

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 621 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
    #1

    I set the timer function and run the graph in real-time plotting point, I have set 2 QPen only, but it shows Extra QPen in my customplot, how to fix it.

    This is my code ,

        QString TestName = ui->TestName_Lbl->text();
        QVector<double> xv1(2);
        QVector<double> yv1(2);
        QVector<double> xv2(2);
        QVector<double> yv2(2);
        xv1[0]=xv1[1]=30;
        xv2[0]=xv2[1]=90;
        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");
        // set axes ranges, so we see all data:
        ui->customPlot->xAxis->setRange(30, 90);
        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->graph(2)->setPen(QPen(Qt::red,8));
        ui->customPlot->graph(2)->setData(xv2,yv2);
        ui->customPlot->replot();
    

    how to remove Extra QPen in my qcustomplot

    WhatsApp Image 2023-06-10 at 10.11.01 AM.jpeg

    Extra pen like X-Axis (40) point ..

    Ramkumar MohanR 1 Reply Last reply
    0
    • Ramkumar MohanR Ramkumar Mohan

      I set the timer function and run the graph in real-time plotting point, I have set 2 QPen only, but it shows Extra QPen in my customplot, how to fix it.

      This is my code ,

          QString TestName = ui->TestName_Lbl->text();
          QVector<double> xv1(2);
          QVector<double> yv1(2);
          QVector<double> xv2(2);
          QVector<double> yv2(2);
          xv1[0]=xv1[1]=30;
          xv2[0]=xv2[1]=90;
          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");
          // set axes ranges, so we see all data:
          ui->customPlot->xAxis->setRange(30, 90);
          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->graph(2)->setPen(QPen(Qt::red,8));
          ui->customPlot->graph(2)->setData(xv2,yv2);
          ui->customPlot->replot();
      

      how to remove Extra QPen in my qcustomplot

      WhatsApp Image 2023-06-10 at 10.11.01 AM.jpeg

      Extra pen like X-Axis (40) point ..

      Ramkumar MohanR Offline
      Ramkumar MohanR Offline
      Ramkumar Mohan
      wrote on last edited by
      #2

      @Ramkumar-Mohan

      @JonB Give me any suggestion to fix the error

      jsulmJ 1 Reply Last reply
      0
      • Ramkumar MohanR Ramkumar Mohan

        @Ramkumar-Mohan

        @JonB Give me any suggestion to fix the error

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Ramkumar-Mohan I'm sure if @JonB has a suggestion he will provide it. Please keep in mind that most people here are not QtCompany employees and do help voluntarily in their free time...

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        Ramkumar MohanR 1 Reply Last reply
        2
        • jsulmJ jsulm

          @Ramkumar-Mohan I'm sure if @JonB has a suggestion he will provide it. Please keep in mind that most people here are not QtCompany employees and do help voluntarily in their free time...

          Ramkumar MohanR Offline
          Ramkumar MohanR Offline
          Ramkumar Mohan
          wrote on last edited by
          #4

          @jsulm Ok

          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
          • Unsolved