Results 1 to 3 of 3

Thread: setAxisMaxMajor not respected by log scale engine?

  1. #1
    Join Date
    Feb 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default setAxisMaxMajor not respected by log scale engine?

    Hi all, I'm plotting a curve using a QwtLogScaleEngine for the xTop axis:

    QwtLogScaleEngine *engine = new QwtLogScaleEngine();
    setAxisScaleEngine(QwtPlot::xTop, engine);

    I'm also trying to use setAxisMaxMajor(QwtPlot::xTop, 2) to limit the number of major scale intervals to 2.

    But the result is that I still get 3 major intervals on the xTop axis:

    logplot.jpg

    Is setAxisMaxMajor(..) not supposed to take effect when using a QwtLogScaleEngine ?

    Thanks in advance.

  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: setAxisMaxMajor not respected by log scale engine?

    QwtPlot::setAxisMaxMajor() is a limit for the ticks - the number of intervals is then always one more.

    What you might want to do is:
    Qt Code:
    1. setAxisMaxMajor(QwtPlot::xTop, numIntervals - 1 );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. #3
    Join Date
    Feb 2009
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setAxisMaxMajor not respected by log scale engine?

    Aha, I see. I think the docs might need updating. They currently say: "Set the maximum number of major scale intervals for a specified axis".

    But I'm still a little confused. The number of intervals should be one less than the number of ticks, shouldn't it?

    Or are the axis start/end not counted as "ticks" in this case? If so I guess I should pass 1 as parameter. I'll give it a try when I'm back at work in ~20 min.

    Thanks for the help!

Similar Threads

  1. Unable to create a debugger engine of type "No engine"
    By beyersdorfertj in forum Installation and Deployment
    Replies: 1
    Last Post: 18th December 2014, 17:13
  2. Replies: 2
    Last Post: 31st August 2013, 14:46
  3. QCache maxcost not respected
    By maitai in forum Qt Programming
    Replies: 10
    Last Post: 28th February 2011, 11:09
  4. QwtScaleEngine Time scale engine
    By med_1309 in forum Qwt
    Replies: 1
    Last Post: 25th August 2010, 19:54
  5. StyleSheets/QTabBar -- max-width property not respected.
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2007, 11:25

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.