Results 1 to 3 of 3

Thread: QwtLinearColorMap not working for a [-26, 0] range data set?

  1. #1
    Join Date
    Dec 2010
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtLinearColorMap not working for a [-26, 0] range data set?

    I am trying to display a spectrogram with values ranging from -26.299 to 0 (it's the log of a normalized spectrogram). With the code below, which is more or less straight out of the spectrogram example, I only get a completely white plot. If I flip the sign of all the data (so that it's [0,26.299]) there is an accurate display (but with the colors flipped, of course).

    I suppose I could just shift all the values to be positive, but I'd rather not do that if I don't have to. Is there a way to get QwtLinearColorMap to work well with this data range?

    Thanks,
    Adam

    Qt Code:
    1.  
    2. QwtLinearColorMap colorMap(Qt::white, Qt::black);
    3. spectrogram->setColorMap(colorMap);
    4. spectrogram->setData(*spectrogramData);
    5.  
    6. QwtDoubleRect r = spectrogramData->boundingRect();
    7. qwtPlot->setAxisScale( QwtPlot::yLeft , 0, 5000, 1000);
    8. qwtPlot->setAxisScale( QwtPlot::xBottom , r.left(), r.right(), 0.1);
    9.  
    10. spectrogram->attach(qwtPlot);
    11. qwtPlot->repaint();
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: QwtLinearColorMap not working for a [-26, 0] range data set?

    What about flipping the colors of the color map too: black -> white instead of white -> black ?

    Uwe

  3. #3
    Join Date
    Dec 2010
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtLinearColorMap not working for a [-26, 0] range data set?

    When I do that the spectrogram just displays all black instead of all white.

Similar Threads

  1. QDoubleVlaidator range
    By johnmauer in forum Qt Programming
    Replies: 1
    Last Post: 20th October 2010, 16:08
  2. Replies: 3
    Last Post: 12th June 2008, 11:59
  3. program for working with Data Base(i need it)
    By banakil in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 22:58
  4. QLineEdit set min max range?
    By whitefurrows in forum Qt Programming
    Replies: 29
    Last Post: 10th June 2006, 23:51
  5. Elements out of Range!!
    By Kapil in forum Newbie
    Replies: 9
    Last Post: 3rd April 2006, 10:28

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.