Results 1 to 3 of 3

Thread: QWT CurvePlot Linked Values

  1. #1
    Join Date
    Feb 2017
    Posts
    2
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Post QWT CurvePlot Linked Values

    Hi everyone,

    I'm a newie in QWT and I need to create a CurveGraph.

    My Problem is that on my curve, my first and last points are always linked like circled in this picture.

    ex_graph_qwt.png
    (Yup, Paint is great )

    I need to delete this link, do somebody know about how doing it ?

    Here's my code in case you need it :

    Qt Code:
    1. void MainWindow::init()
    2. {
    3. xgraph->resize(10000); // Capacité max à voir avec JWI
    4. ygraph->resize(10000);
    5.  
    6. Courbe1->setPen(* new QPen(Qt::red,5,Qt::SolidLine));
    7. Courbe1->attach(Graph1);
    8. Graph1->setTitle("Acquisition de la Température");
    9. Graph1->setParent(ui->groupBox_2);
    10. }
    11.  
    12. void MainWindow::createGraphs(int spvalue)
    13. {
    14. QVector<double> x(1000);
    15. QVector<double> y(1000);
    16. x.swap(*xgraph);
    17. y.swap(*ygraph);
    18.  
    19. x.replace(nb_inc_sp1, (double)nb_inc_sp1);
    20. y.replace(nb_inc_sp1, (double)spvalue);
    21.  
    22.  
    23. qDebug() << x << "and" << y;
    24.  
    25. Courbe1->setSamples(x, y);
    26. Graph1->replot();
    27.  
    28. x.swap(*xgraph);
    29. y.swap(*ygraph);
    30.  
    31. }
    To copy to clipboard, switch view to plain text mode 

    Thanks to all !

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWT CurvePlot Linked Values

    Usually a problem of having a vector, that is too large by one and the uninitialized last value is ( 0, 0 ) by default.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    Unshortafleur (8th February 2017)

  4. #3
    Join Date
    Feb 2017
    Posts
    2
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QWT CurvePlot Linked Values

    Hi Uwe,
    Thanks for your answer, that helped me a lot!
    The Vector's size is 1000 and when I put a X value at index 1, the Value of the 999 others were 0 and not X.

    Best regards

Similar Threads

  1. Replies: 5
    Last Post: 27th November 2014, 11:15
  2. Replies: 8
    Last Post: 28th January 2014, 09:09
  3. How to convert string hex values to its real binary values?
    By AttilaPethe in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2012, 23:47
  4. not the architecture being linked
    By skizzik in forum Qt Programming
    Replies: 8
    Last Post: 14th October 2010, 10:46
  5. Linked List
    By merry in forum Qt Programming
    Replies: 10
    Last Post: 14th March 2007, 08:07

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.