Results 1 to 1 of 1

Thread: Qwt log scale for frequency

  1. #1
    Join Date
    Aug 2013
    Posts
    41
    Thanks
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Qwt log scale for frequency

    Hello,

    I would like have x-axis of my Qwt plot in logarithmic scale. I have seen the bode example but was not able to implement it as desired. (I think some classes have been changed/renamed).
    I would like to have the x-scale as shown in the attached plot1.jpg

    So far, I have written the following lines:

    Qt Code:
    1. QwtText XAxisLabel;
    2. XAxisLabel.setText("Frequency [Hz]");
    3. setAxisTitle(QwtPlot::xBottom, XAxisLabel);
    4. setAxisScaleEngine(QwtPlot::xBottom, new QwtLogScaleEngine);
    To copy to clipboard, switch view to plain text mode 

    Please help me.


    Added after 31 minutes:


    Got it! :-)
    Following is the solution:

    Qt Code:
    1. QwtText XAxisLabel;
    2. XAxisLabel.setText("Frequency [Hz]");
    3. setAxisTitle(QwtPlot::xBottom, XAxisLabel);
    4. setAxisMaxMajor(QwtPlot::xBottom, 6);
    5. setAxisMaxMinor(QwtPlot::xBottom, 10);
    6. setAxisScaleEngine(QwtPlot::xBottom, new QwtLogScaleEngine);
    7. setAxisScale(QwtPlot::xBottom, 10.0, 5000.0);
    To copy to clipboard, switch view to plain text mode 
    Attached Images Attached Images
    Last edited by uz_qt; 25th November 2013 at 12:52.

Similar Threads

  1. Qt and frequency of a display?
    By spherrra in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2011, 17:52
  2. QAudioInput Frequency and Amplitude
    By stormtrooper5 in forum Qt Programming
    Replies: 4
    Last Post: 22nd February 2011, 18:18
  3. Frequency of Audio Track
    By vijay_kansal in forum Qt Programming
    Replies: 5
    Last Post: 28th July 2010, 10:15
  4. Frequency of sound data
    By momesana in forum General Programming
    Replies: 1
    Last Post: 10th May 2010, 22:21
  5. Replies: 0
    Last Post: 21st January 2010, 14:35

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.