Results 1 to 4 of 4

Thread: is it possible to plot points without connecting points with line?

  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default is it possible to plot points without connecting points with line?

    Hi,
    I have two questions. 1- when plotting like below example, points be connected together by lines. I need the points be plotted and there be no line. 2- my data is too huge and i want to use float instead of double but setSamples function gives two "QVector< double > &" . is it possible to use QVector< float > & ???
    for example:
    Qt Code:
    1. QVector<double> v(10);
    2.  
    3. v<<0<<1<<2<<3<<4<<5<<6<<7<<8<<9;//1-is it possible only this points be showed without any line between them?
    4.  
    5. c.setSamples(v, v);//2-how could i use Qvector<float> instead of Qvector<double>?
    6. c.attach(&p);
    7.  
    8. p.show();
    To copy to clipboard, switch view to plain text mode 

    thanks for any help
    Last edited by Alex22; 13th December 2015 at 19:56.

  2. #2
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: is it possible to plot points without connecting points with line?

    Please this post be deleted. i think right position for ask is "Newbie". sorry about this.

  3. #3
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: is it possible to plot points without connecting points with line?

    Hello,

    set the curve style to Dots (see qwt documentation of QwtPlotCurve::CurveStyle).

    my data is too huge
    What do you mean by too huge (how many data points)? Qwt can handle really big traces (I use traces with 100 million points), but in this case you have to do some data reduction because default plotting of such a big number of points takes far too much time.

    If you need float for storing your data in your application business logic, you can extract a reduced trace from these data for qwt display. Have a look at the abstract class QwtSeriesData and derive your own series data class from QwtSeriesData< QPointF >. Then use QwtPlotCurve method
    Qt Code:
    1. void setSamples (QwtSeriesData< QPointF > *)
    To copy to clipboard, switch view to plain text mode 
    . Your QwtSeriesData<> derived class would access your float data, convert them to a pair of double (QPointF) and return this to the curve for plotting.

    I think you have chosen the right place for asking your qwt related question, so from my point of view no need for moving or deleting your question.

    Best regards
    ars

  4. The following user says thank you to ars for this useful post:

    Alex22 (16th December 2015)

  5. #4
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: is it possible to plot points without connecting points with line?

    Thanks ars,

    What do you mean by too huge (how many data points)?
    I want to plot more than 10 curves together, each curve has 30,000,000 points. while attaching new curve, speed of plotting goes to be more slower and slower. there is no memory leakage.

    thank you again ars
    Last edited by Alex22; 16th December 2015 at 20:08.

Similar Threads

  1. Replies: 2
    Last Post: 2nd May 2012, 09:49
  2. Connecting 2 points using QML
    By aya_lawliet in forum Qt Quick
    Replies: 0
    Last Post: 4th November 2011, 08:05
  3. Connecting Points using Qt
    By prajna8 in forum Newbie
    Replies: 4
    Last Post: 29th October 2010, 05:28
  4. Editing points on QWt Plot
    By manmohan in forum Qwt
    Replies: 6
    Last Post: 14th May 2010, 07:43
  5. move/drag points on qwt plot
    By rambo83 in forum Qwt
    Replies: 5
    Last Post: 23rd November 2009, 08:36

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.