Results 1 to 6 of 6

Thread: QwtPolarSpectrogram with inverted Radius

  1. #1
    Join Date
    Mar 2017
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11

    Question QwtPolarSpectrogram with inverted Radius

    I need to create a PolarSpectrogram for the following scales.
    Azimuth = 0 to 360 in steps of 15 degrees
    Radius = 0 to 90 in steps of 10 degrees.

    I use the following code to have clock-wise scaling for Azimuth.
    Qt Code:
    1. setScale(QwtPolar::Azimuth, 360 , 0 , 30);
    2. setScaleMaxMinor(QwtPolar::Azimuth, 2);
    To copy to clipboard, switch view to plain text mode 

    But the inversion does not work for Radius.
    Qt Code:
    1. setScale(QwtPolar::Radius, 90 , 0 , 20);
    2. setScaleMaxMinor(QwtPolar::Radius, 2);
    To copy to clipboard, switch view to plain text mode 

    While the default 0 to 90 works fine. (see image: I just need the 0 - 90 be 90 - 0 )

    I am using a QwtMatrixRasterData to provide 216 (24 columns and 9 rows) entries for these divisions. The interval for the data is set as
    Qt Code:
    1. setInterval( Qt::XAxis, QwtInterval( 0.0, 360.0 ) );
    2. setInterval( Qt::YAxis, QwtInterval( 0.0,90.0 ) );
    To copy to clipboard, switch view to plain text mode 

    I have tried switching the interval for the data and setting ScaleDiv(1, QwtScaleDiv(90, 0)) for the plot.

    I'd appreciate any help. Thanks!
    Attached Images Attached Images

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

    Default Re: QwtPolarSpectrogram with inverted Radius

    The radius is nothing that can be inverted - what is a negative radius supposed to be ?

    Uwe

  3. #3
    Join Date
    Mar 2017
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: QwtPolarSpectrogram with inverted Radius

    Not a negative radius, just inverted order - 90 to 0 (The center being 90 degrees) . The spectrogram is now 0 to 90 degrees elevation/radius with 0 as the center.
    Switching max and min for setScale would not work.
    setInterval( Qwt::Radius, 0, 90, 20) works
    setInterval (Qwt::Radius, 90, 0 ,-20(or 20) ) just renders a white plot.

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

    Default Re: QwtPolarSpectrogram with inverted Radius

    The polardemo shows how to invert the radial axis. If you do the same with the spectrogram example ( f.e by changing the slot being called for one of the buttons like below ) you see - tamteramteram: nothing.
    But well after changing the 10 in the formula of SpectrogramData::value to 11 you have an image that looks different, when being inverted.

    Qt Code:
    1. void Plot::invert()
    2. {
    3. setScale( QwtPolar::Radius,
    4. scaleDiv( QwtPolar::Radius )->upperBound(),
    5. scaleDiv( QwtPolar::Radius )->lowerBound() );
    6.  
    7. replot();
    8. }
    To copy to clipboard, switch view to plain text mode 
    Uwe

  5. #5
    Join Date
    Mar 2017
    Posts
    3
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: QwtPolarSpectrogram with inverted Radius

    Thanks for the response.

    That would essentially work only when there is no SetInterval specified for the X and Y axis.
    Because, I am using QwtMatrixRasterData and not QwtRasterData, it is mandatory that I specify X and Y axis interval.

    And when I do that as mentioned earlier, the value() function is not able find the value from the matrix (only in the inverted scale).

    So for a scale like this
    Qt Code:
    1. setInterval( Qt::XAxis, QwtInterval( 0.0, 360.0 ) );
    2. setInterval( Qt::YAxis, QwtInterval( 0.0,90.0 ) );
    To copy to clipboard, switch view to plain text mode 

    I am setting a matrix with 216 values ( 24 azimuth columns and 9 radius rows) using setValueMatrix and the value() function finds it as long as the scale is 0 to 90 and not the other way around.

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

    Default Re: QwtPolarSpectrogram with inverted Radius

    Quote Originally Posted by ishitha92 View Post
    That would essentially work only when there is no SetInterval specified for the X and Y axis.
    As long as the intervals of the axes and those from the data intersect something should be displayed.
    But better start your debugger and check what is going on in QwtMatrixRasterData::value().

    Uwe

Similar Threads

  1. Replies: 0
    Last Post: 5th August 2016, 10:21
  2. Replies: 9
    Last Post: 24th April 2015, 16:39
  3. Replies: 2
    Last Post: 28th January 2015, 15:27
  4. Inverted QTextEdit
    By TMan in forum Qt Programming
    Replies: 2
    Last Post: 31st July 2009, 17:35
  5. QWTdial inverted range
    By jmsbc in forum Qwt
    Replies: 1
    Last Post: 12th January 2009, 22:21

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.