Results 1 to 5 of 5

Thread: axisScaleEngine Floating does not work as documented

  1. #1
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default axisScaleEngine Floating does not work as documented

    All I want is for the endpoints of the scale to match the outliers of the input sources. So if I have inputs 0,0 and 2000,1000, then the x axis should go from 0 to 2000 and the y axis to go from 0 to 1000.

    So I have the code:

    Qt Code:
    1. qwtPlot->axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating,true);
    2. qwtPlot->axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating,true);
    3. qwtPlot->setAxisAutoScale(QwtPlot::xBottom);
    4. qwtPlot->setAxisAutoScale(QwtPlot::yLeft);
    To copy to clipboard, switch view to plain text mode 

    The x axis is OK, and matches the inputs. But the Y axis goes from 0 to 30,000???

    Thanks for the help.

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

    Default Re: axisScaleEngine Floating does not work as documented

    What are the parameter values of QwtLinearScaleEngine::autoScale for this scale ?

    Uwe

  3. #3
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: axisScaleEngine Floating does not work as documented

    That's all the code I have. Isn't it supposed to read the values in the plot and do this automatically?

    I added this but there's no change

    Qt Code:
    1. qwtPlot->setAxisScaleEngine(QwtPlot::xBottom, scaleEngine );
    2. scaleEngine = new QwtLinearScaleEngine;
    3. qwtPlot->setAxisScaleEngine(QwtPlot::yLeft, scaleEngine );
    4. qwtPlot->axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating,true);
    5. qwtPlot->axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating,true);
    6. qwtPlot->setAxisAutoScale(QwtPlot::xBottom);
    7. qwtPlot->axisScaleEngine(QwtPlot::xBottom)->setMargins(0,0);
    8. qwtPlot->setAxisAutoScale(QwtPlot::yLeft);
    9. qwtPlot->axisScaleEngine(QwtPlot::yLeft)->setMargins(0,0);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 879 Times in 827 Posts

    Default Re: axisScaleEngine Floating does not work as documented

    I asked for parameter values, that are passed at runtime to a certain method.

    Uwe

  5. #5
    Join Date
    Aug 2009
    Posts
    56
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: axisScaleEngine Floating does not work as documented

    It's fixed now. I was using show() and hide() and didn't know it would adjust for that

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.