Results 1 to 4 of 4

Thread: Axis not aligning with Spectrogram image

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    May 2010
    Posts
    24
    Thanks
    14
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Axis not aligning with Spectrogram image

    Quote Originally Posted by Uwe View Post
    Obviously your data bins cover squares with a size of 1, f.e one square is from 5-6, 10-11. So if you want to have a ticks centered its positions need to be 5.5, 10.5.

    But I guess what you really want is a square at 4.5-5-5, 9.5.10.5 - probably by using qRound() instead of floor ( = casting to int ) in YourRasterData::value().

    Uwe

    PS: If the resolutions of your data is 1x1 don't forget to implement YourRasterData::rasterHint(). It will make the rendering process much faster.
    Thanks for your reply Uwe. I modified my code to use qRound -- I also had to change the axis and the spectrograms bounding rect. The attached plot shows the result (it looks good!).

    I dont quite understand your advice about rasterHint -- very much a graphics novice here. I am going to look through the examples to see if I can figure out what you mean. Btw, each data point (bin) of my data should be square (though I can live with rectangles!).
    Attached Images Attached Images

Similar Threads

  1. get min and max value from spectrogram
    By rambo83 in forum Qwt
    Replies: 1
    Last Post: 2nd December 2009, 14:25
  2. qwt spectrogram example
    By rambo83 in forum Qwt
    Replies: 2
    Last Post: 17th November 2009, 21:13
  3. Aligning widgets in different layouts
    By negritot in forum Qt Tools
    Replies: 4
    Last Post: 9th March 2009, 16:07
  4. Aligning message displayed on QStatusbar
    By sanjayshelke in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2008, 09:41
  5. Aligning a stringlist
    By impeteperry in forum Qt Programming
    Replies: 1
    Last Post: 22nd May 2006, 17:45

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
  •  
Qt is a trademark of The Qt Company.