Results 1 to 5 of 5

Thread: QwtPlot Performance: HowTo plot a lot points?

  1. #1
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question QwtPlot Performance: HowTo plot a lot points?

    Hi to everybody.
    Are there any tricks to deal with a large amount of datapoint in QwtPlot? If I draw 500'000 points it takes a couple of time on every redraw.
    I've tried the following without success:

    Qt Code:
    1. myQwtPlot.canvas()->setPaintAttribute( QwtPlotCanvas::PaintCached, false );
    2. myQwtPlot.canvas()->setPaintAttribute( QwtPlotCanvas::PaintPacked, false );
    3. myQwtPlotCure.setPaintAttribute( QwtPlotCurve::PaintFiltered, true );
    To copy to clipboard, switch view to plain text mode 

    I've also added the zoom-implementation from the examples. If I click and move the mouse to position the rubberband for the zoom, the qwtPlot freezes for about 3 seconds!

    I'm new in Qwt and don't see any way to solve the problem --> plese help me.

    Thanks in advance
    elDell

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

    Default Re: QwtPlot Performance: HowTo plot a lot points?

    Try:
    Qt Code:
    1. myQwtPlotCure->setPaintAttribute( QwtPlotCurve::ClipPolygons, true );
    To copy to clipboard, switch view to plain text mode 

    Uwe

  3. #3
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlot Performance: HowTo plot a lot points?

    Unfortunately, this doesn't increase the performance:
    setPaintAttribute( QwtPlotCurve::ClipPolygons, true );
    Any other tips?

    elDell

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

    Default Re: QwtPlot Performance: HowTo plot a lot points?

    QwtPlotCurve::ClipPolygons improves the performance significant, for situations, where you zoom in and many points are outside of the visible area ( assuming you have a curve style, where your points are connected ).

    For situations where all points are inside of the visible area you have to reduce the number of points you want to paint. It's obvious that 500000 points on a widget with 1000 pixels doesn't make too much sense. Reducing can be done by implementing different levels of detail - depending on the zoom level. ( f.e only every 10th point ).

    You didn't write about the characteristics of your data. If your data isn't a series of points it might be better to use a different type of plot item.

    Uwe

  5. #5
    Join Date
    May 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Re: QwtPlot Performance: HowTo plot a lot points?

    Hi Uwe

    Thanks a lot for your replay. Now I'm shure that there aren't any other qwt-options to improve performance --> I'm goning to reduce the points by writing my own filter!

    Just for information, the points are all inside the visible area and I use a curve type with connected points.

    Thanks a lot again
    elDell

Similar Threads

  1. Replies: 2
    Last Post: 12th September 2012, 07:43
  2. Replies: 12
    Last Post: 31st October 2010, 17:08
  3. Replies: 1
    Last Post: 2nd October 2008, 07:29
  4. Replies: 7
    Last Post: 22nd September 2008, 22:05

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.