Results 1 to 3 of 3

Thread: How to transpose xAxis and yAxis for QwtPlotSpectrogram?

  1. #1
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to transpose xAxis and yAxis for QwtPlotSpectrogram?

    Hi everybody,

    is there a way to transpose the xAxis and the yAxis (e.g. xAxis pointing up, yAxis pointing to right) in a QwtPlotSpectrogram.

    The reason why I don't simply change the data is that I want to make a fast animation of a large matrix and with
    Qt Code:
    1. setValueMatrix(QVector.mid(0,i*n_cols),n_cols)
    To copy to clipboard, switch view to plain text mode 
    I can very efficiently extract a sub-matrix but then the animation is row-wise instead of column-wise.

    Thanks a lot
    Marco

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

    Default Re: How to transpose xAxis and yAxis for QwtPlotSpectrogram?

    Maybe deriving from QwtRasterData makes more sense than using QwtMatrixRasterData in your situation.

    But if you want to use QwtMatrixRasterData you can simply:

    Qt Code:
    1. YourRasterData: public QwtMatrixRasterData
    2. {
    3. public:
    4. ....
    5.  
    6. virtual double value( double x, double y ) const
    7. {
    8. return QwtMatrixRasterData::value( y, x );
    9. }
    10. };
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. #3
    Join Date
    May 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to transpose xAxis and yAxis for QwtPlotSpectrogram?

    Hi Uwe,

    Thanks a lot. Your solution worked fine.

    By the way I'm really impressed by the speed of qwt. I used vtk before which is good for 3D graphics but for 2D qwt is much better.

    Best regards,
    Marco

Similar Threads

  1. Google map on QwtPlotSpectrogram
    By sagittager in forum Qwt
    Replies: 4
    Last Post: 15th October 2011, 15:32
  2. QwtScaleDraw align label to xaxis
    By kja in forum Qwt
    Replies: 1
    Last Post: 21st November 2010, 19:55
  3. Replies: 2
    Last Post: 26th March 2009, 07:53
  4. Replies: 5
    Last Post: 20th January 2009, 09:13
  5. Irregular data and QwtPlotSpectrogram
    By seveninches in forum Qwt
    Replies: 1
    Last Post: 27th January 2008, 10:52

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.