Results 1 to 12 of 12

Thread: Help understanding QWT Contour Plot

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Help understanding QWT Contour Plot

    1. So given the scenario of my problem (having only about 20 data points in real world), what I should do is implement some sort of contour algorithm like CONREC or Perlin Noise to fill a large enough array of data points based on my original 20 data points.
    A contour plot shows border line between areas with values above/below a threshold. But a point is no area and 20 points somewhere in space will never result in a useful contour plot ! This has nothing to do with Qwt or the algorithm that is used for contouring. So before you continue better try to find out where the areas are you want to display and if your points are raster data at all !
    2. Or if I when created my database use the screen coordinates for each of my data point instead of the real world coordinates then the sizes and coordinates here are the widget coordinates. Correct?
    No.
    3. My covered area may change in size from time to time. But when I try to reset the bounding rect (after it's been initialized to some size), nothing happens. I did it like this:

    myRasterData->setBoundingRect(QwtDoubleRect(-new_xlen/2, -new_ylen/2, new_xlen, new_ylen);
    myPlot->replot();
    The image of the spectrogram is cached. If you change something relevant behind the back of the spectrogram item you have to invalidate the cache ( spectrogram->invalidateCache() ) before you replot.

    Uwe

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

    jwieland (12th September 2009)

  3. #2
    Join Date
    Feb 2009
    Posts
    51
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: Help understanding QWT Contour Plot

    Hi Uwe,

    I almost figure it out now! There still some problem I need your help with: Since our app is constantly monitoring data for changes and update the contour plot whenever it does, we need to update the plot very quite often. However, when I updated the data and try to call replot() to update the plot, nothing happen! The plot is still showing old data.

    What am I missing that results in this plot not refreshing? What is the proper way to do this?

    Thank you so much for your help.
    Sincerely,

    Wieland J.

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

    Default Re: Help understanding QWT Contour Plot

    Quote Originally Posted by jwieland View Post
    However, when I updated the data and try to call replot() to update the plot, nothing happen! The plot is still showing old data.
    Read my previous answer.

    Uwe

  5. #4
    Join Date
    Feb 2009
    Posts
    51
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: Help understanding QWT Contour Plot

    Hi Uwe,

    Sorry but that didn't work. Taking the spectrogram example and modified it, here is what I did:
    SpectrogramData( ... ) : QwtRasterData( ... )), ... {
    ...
    val = 0.2;
    }


    virtual double value(double x, double y) const
    {
    // do some calculation here to figure data at x, y
    ...

    return val;
    }

    double val;
    ...


    And then I tried changing the value of val variable and call the invalidateCache() before replot() to no avail!

    Any idea what could went wrong?
    Sincerely,

    Wieland J.

  6. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: Help understanding QWT Contour Plot

    You forgot to adjust SpectrogramData::copy(). Note, that when this operation does a deep copy you need to rassign ( spectrogram->setData()) your data whenever you change the original.

    Uwe

  7. #6
    Join Date
    Feb 2009
    Posts
    51
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2

    Default Re: Help understanding QWT Contour Plot

    Thanks, Uwe. You are a life saver!!!

    It all works out now. wonderful!@
    Sincerely,

    Wieland J.

  8. #7
    Join Date
    Sep 2009
    Location
    phoenix, AZ
    Posts
    41
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help understanding QWT Contour Plot

    jwieland,

    could you post your code to plot contours of yours data ???

    thanks,

    Michael

Similar Threads

  1. Embedding Qwt plot High Resolution
    By giusepped in forum Qwt
    Replies: 7
    Last Post: 21st April 2009, 10:44
  2. legend inside qwt plot
    By kaustav98255 in forum Qwt
    Replies: 5
    Last Post: 11th February 2009, 21:39
  3. Detecting changes in the qwt plot axis
    By mrcolin in forum Qwt
    Replies: 2
    Last Post: 27th January 2009, 13:53
  4. export and printing qwt plot
    By giusepped in forum Qwt
    Replies: 6
    Last Post: 17th December 2008, 08:04
  5. Qwt plot problem on compile
    By sincnarf in forum Qwt
    Replies: 2
    Last Post: 14th October 2007, 12: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
  •  
Qt is a trademark of The Qt Company.