Results 1 to 2 of 2

Thread: Plotting 3d using non-grid data

  1. #1
    Join Date
    Feb 2013
    Qt products

    Default Plotting 3d using non-grid data

    Does anyone know a qt (or c++) library supports plotting 3d plots using non grid data?

    I tried qwtplot3d (using function loadFromData) but the output plot is not smooth.

    What I need:

    What I did

    Thank you very much!

  2. #2
    Join Date
    Jan 2008
    Alameda, CA, USA
    Thanked 691 Times in 681 Posts
    Qt products
    Windows Android

    Default Re: Plotting 3d using non-grid data

    Try using bilinear interpolation to resample your non-uniform data onto a regular uniform grid and then using that in qwtplot3d. I don't think qwtplot3d can handle non-uniform data. Wikipedia has a good discussion of bilinear interpolation.

    Note that if your regular grid has larger unit spacing than the non-uniform data, then certain grid cells will contain more than one data point. When you do the interpolation, you add each of these contributions to the values at the four corners of the cell. You have to remember how many data points contribute to each grid point so at the end, you can divide the total sum by the number of contributions. If you don't you will get a spike at any grid point that has more than one data point contributing to it.

    By the way, this is a pretty simple way to implement a "level of detail" feature: set the regular grid to a fixed, constant size in pixels (e.g. 1000 x 1000). As you zoom into your data, the number of data points in a grid cell will decrease, so the interpolated result shows a greater level of detail.

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

    warcraff123456 (16th March 2013)

Similar Threads

  1. Replies: 7
    Last Post: 15th May 2019, 09:44
  2. QT 4.5 and Plotting data
    By Lezer in forum Qt for Embedded and Mobile
    Replies: 3
    Last Post: 6th September 2012, 13:11
  3. axes for plotting data
    By timmu in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2012, 12:19
  4. Plotting socket data
    By catto in forum Qwt
    Replies: 4
    Last Post: 6th March 2011, 08:01
  5. Widget for data plotting
    By Benjamin in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2009, 15:38

Tags for this Thread


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.