Results 1 to 5 of 5

Thread: Auto scale with margin

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Auto scale with margin

    I want to use Autoscaling for QWT plot item. Is it possible to specify a small %margin for autoscale?. For example if y range is -2 to 10, I want it to autoscale to ( (-2) - 10% of range) to (10 + 10% of range)

  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: Auto scale with margin

    QwtScaleEngine::setMargins() ?

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    mqt (1st August 2013)

  4. #3
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Auto scale with margin

    There is one problem. I have the plot with size almost (not exactly) X=0 to 1.0 and Y=0 to 1.0. The limits vary dynamically small amounts like +/- 0.3
    Whatever margin i set using, say, setMargins(0.05), it sets the margin as 0.2. What am I missing?

  5. #4
    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: Auto scale with margin

    The margins ( set with setMargins() ) are added to the interval that is used by the autoscaler. If QwtScaleEngine::Floating is not set, the autoscaler aligns the interval to a step size.
    So maybe also enabling QwtScaleEngine::Floating is what you are looking for.

    Uwe

  6. #5
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Auto scale with margin

    That worked...Thanks Uwe

Similar Threads

  1. Auto scale of QwtPoltItem.
    By jesse_mark in forum Qwt
    Replies: 1
    Last Post: 24th June 2013, 22:16
  2. Axis Auto Scale
    By gkarthick5 in forum Qwt
    Replies: 3
    Last Post: 13th July 2011, 14:57
  3. Auto scale a QGraphicsView
    By niluje in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2011, 00:43
  4. QwtPlot: how to auto-scale two Y scales?
    By paradiza in forum Qwt
    Replies: 4
    Last Post: 24th March 2009, 02:28
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 02:12

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.