Results 1 to 3 of 3

Thread: Aligning ticks to data in a Spectrogram using QwtMatrixRasterData

  1. #1
    Join Date
    Apr 2014
    Posts
    34
    Thanks
    14
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Aligning ticks to data in a Spectrogram using QwtMatrixRasterData

    Hello,

    I have a matrix of data (5 rows by 16 columns) that I am displaying in a spectrogram. However, I cannot figure out how to get the ticks along the X and Y axis to align with the data (which appear as colored cells). I've attached an image of the results I get.

    spsc.png

    What I want is for a tick to be centered, horizontally and vertically, within its associated colored cell. How can this be accomplished?

    Thanks

  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: Aligning ticks to data in a Spectrogram using QwtMatrixRasterData

    You need to have the ticks at 0.5, 1.5 ... to have them centered.

    If you don't need zooming it can be done by creating an QwtScaleDiv manually - otherwise you need to set the parameters for the scale engine properly. Then you can change the labels representing the values to 1, 2 .. by overloading QwtScaleDraw::label().

    Uwe

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

    SpiceWeasel (16th October 2017)

  4. #3
    Join Date
    Apr 2014
    Posts
    34
    Thanks
    14
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Aligning ticks to data in a Spectrogram using QwtMatrixRasterData

    Quote Originally Posted by Uwe View Post
    You need to have the ticks at 0.5, 1.5 ... to have them centered.

    If you don't need zooming it can be done by creating an QwtScaleDiv manually - otherwise you need to set the parameters for the scale engine properly. Then you can change the labels representing the values to 1, 2 .. by overloading QwtScaleDraw::label().

    Uwe
    I do need zooming... which I am working on right now. I am not familiar with QwtScaleEngine and QwtScaleDraw -- going to have to do some experimenting. Thanks Uwe.

Similar Threads

  1. Replies: 1
    Last Post: 7th June 2017, 08:19
  2. Replies: 14
    Last Post: 30th October 2012, 16:45
  3. Replies: 3
    Last Post: 15th May 2010, 19:48
  4. Spectrogram data resolution...
    By uppu in forum Qwt
    Replies: 4
    Last Post: 9th December 2009, 11:13
  5. Replies: 6
    Last Post: 17th June 2008, 08:28

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.