Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to optimized the data point in Qwt plot?
QtWS25 Last Chance

How to optimized the data point in Qwt plot?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qwtplotc++
4 Posts 2 Posters 1.3k Views
  • 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.
  • Y Offline
    Y Offline
    Yash001
    wrote on 6 Dec 2019, 00:09 last edited by
    #1

    Hi,

    I am using qwtplot library to plot the graph. I would like to represent more than 5 million data point on graph.

    I found some solution like below.

    1. from: https://www.qtcentre.org/threads/45488-Speed-of-Qwt-plotting-slows-with-many-points
    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. 
    
    1. from http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/memory_management_for_large_data_sets/
      section: Displaying Large Data Sets.

    how can i get width of canvas in pixel? .
    i tried handler.plot->canvas()->width();. but it is constant if I will do Zoom in and Zoom out in graph.

    any other parameter can I use instead of width of the canvas, so that I can modify the chunk size with respect to zoom in and zoom out.

    1 Reply Last reply
    0
  • M Offline
    M Offline
    mrjj Lifetime Qt Champion
    wrote on 6 Dec 2019, 16:07 last edited by
    #2

    Hi
    If you dont get any answers here, try the mailing list
    https://sourceforge.net/p/qwt/mailman/
    The Author hangs out there.

    Y 1 Reply Last reply 6 Dec 2019, 16:13
    1
  • Y Offline
    Y Offline
    Yash001
    replied to mrjj on 6 Dec 2019, 16:13 last edited by
    #3

    @mrjj Thank you for right direction.

    M 1 Reply Last reply 6 Dec 2019, 16:14
    0
  • M Offline
    M Offline
    mrjj Lifetime Qt Champion
    replied to Yash001 on 6 Dec 2019, 16:14 last edited by
    #4

    @Yash001
    Hi, i wish i knew the answer
    but im fairly sure canvas()->width(); just returns the actual widget size and
    not the zoomed area as such.

    Had a look in the help but didnt find the answer on how to get the extent on a zoomed canvas.

    1 Reply Last reply
    1

2/4

6 Dec 2019, 16:07

topic:navigator.unread, 2
  • Login

  • Login or register to search.
2 out of 4
  • First post
    2/4
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved