Results 1 to 9 of 9

Thread: Speed of Qwt plotting slows with many points

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Speed of Qwt plotting slows with many points

    It's quite simple.

    Imagine you have 1M points and 1K pixels wide canvas (for sake of simplicity).
    You can't draw all 1M points, many of them will overlap in the same pixel.

    Divide amount of points you have by the width of the canvas (in pixels).
    In example above you'll end up with 1K points per canvas pixel (width-wise).
    All this 1K points can be represented using only two points as a single vertical line resulting in 98% compression.
    Just go through the points and record lowest and highest Y value, then create a line using those two values and X of the canvas pixel and you're done.
    Repeat it 1K times and you'll end up with 98% less data to draw.

    You have to do that every time data or canvas size changes. Also when you zoom in, you effectivley change the data available to draw so you have to recalculate.

  2. The following user says thank you to Spitfire for this useful post:

    Momergil (27th May 2014)

Similar Threads

  1. Replies: 4
    Last Post: 6th October 2010, 13:29
  2. QTcpSocket slows down in receiving after several minutes
    By cutie.monkey in forum Qt Programming
    Replies: 1
    Last Post: 9th December 2009, 21:14
  3. rendering svg using QGraphicsSVGItem slows doen the performance
    By sanjayshelke in forum Qt Programming
    Replies: 4
    Last Post: 1st September 2009, 06:52
  4. Plotting specific points with qwt
    By byb810 in forum Qwt
    Replies: 0
    Last Post: 30th July 2009, 15:42
  5. Plotting points
    By afflictedd2 in forum Qt Programming
    Replies: 8
    Last Post: 26th February 2009, 08:20

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
  •  
Qt is a trademark of The Qt Company.