Results 1 to 1 of 1

Thread: qwt axis scale

  1. #1
    Join Date
    Aug 2011
    Qt products
    Unix/X11 Windows

    Default qwt axis scale

    I'm trying to adopt the x-axis scale of my QwtPlot (qwt. 6.0.1).

    I want to do some kind of auto-scale, because in my opinion qwt's autoscale engine does quite well.
    I changed qwt's sources so far in qwt_scale_engine.cpp:

    Qt Code:
    1. double QwtScaleEngine::divideInterval(
    2. double intervalSize, int numSteps ) const
    3. {
    4. if ( numSteps <= 0 )
    5. return 0.0;
    7. double v = QwtScaleArithmetic::divideEps( intervalSize, numSteps );
    8. return QwtScaleArithmetic::ceil125( v );
    9. }
    To copy to clipboard, switch view to plain text mode 
    my modifications:
    Qt Code:
    1. double QwtScaleEngine::divideIntervalNoCeil(
    2. double intervalSize, int numSteps ) const
    3. {
    4. if ( numSteps <= 0 || intervalSize == 0.0)
    5. return 0.0;
    7. return (intervalSize / numSteps);
    8. }
    To copy to clipboard, switch view to plain text mode 

    The original code scales very good intervals, but the curve isn't painted up to the right border. The last point of my curve is somewhere between the last and the last but one scale-division.
    The result of my changes is that my curve is painted over all the canvas from the left to the right border, but I get interval-sizes of double numbers (e.g. 317 points / interval).
    But I want to change the code further with the result, that I want to get interval-sizes, which the original code from above will scale (20, 100, 1000, ...), but my curve is painted all over the canvas, as my modification does. So the first intervals will be of the same size (e.g. 20 points / interval) and the last interval will be shorter (e.g. 11 points / interval).

    What can I do?
    Last edited by Markus_AC; 15th December 2011 at 09:49.

Similar Threads

  1. Axis Auto Scale
    By gkarthick5 in forum Qwt
    Replies: 3
    Last Post: 13th July 2011, 13:57
  2. Replies: 4
    Last Post: 16th January 2011, 10:32
  3. qwp plot axis scale
    By Cal in forum Qwt
    Replies: 1
    Last Post: 11th May 2009, 17:10
  4. Axis with a probability scale
    By Lister in forum Qwt
    Replies: 1
    Last Post: 5th May 2009, 06:45
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 01:12


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.