Results 1 to 8 of 8

Thread: improve the auto scaling of axis

  1. #1
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default improve the auto scaling of axis

    Hello,

    now, i plot curve with a logarithmic X axis:

    Qt Code:
    1. myplot->setAxisScaleEngine(QwtPlot::xBottom, new QwtLog10ScaleEngine)
    To copy to clipboard, switch view to plain text mode 

    the result is not very nice:

    the original scale is between 1e-100 and 1, if autoscale works nice is not a problem for me but, there is a problem.
    my values are between 1 and 2 and during the ploting the scale stay between 1e-100 and 1e20, So my curve is like a vertical line

    => how i can modify this? can we fix originals boundaries for this autoscaling?

  2. #2
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default Re: improve the auto scaling of axis

    excuse me for this thread
    => i have a 0 for the first value it's the problem

    see you


    Added after 1 25 minutes:


    finally i haven't already a problem:

    i use this to plot my curve:
    Qt Code:
    1. for (int z=1;z<timeNb6;z++)
    2. {
    3. if (Points2_OneXtwoY[z][0]<0.002)
    4. {
    5. }
    6. else
    7. {
    8. x6 << Points2_OneXtwoY[z][0] ;
    9. y6 << Points2_OneXtwoY[z][1] ;
    10. x7 << Points2_OneXtwoY[z][0] ;
    11. y7 << Points2_OneXtwoY[z][2] ;
    12. }
    13. }
    14. AtomicCurve1.setSamples(x6.data(),y6.data(),x6.size());
    15. AtomicCurve2.setSamples(x7.data(),y7.data(),x7.size());
    To copy to clipboard, switch view to plain text mode 

    So in my plot i can't have a point for x6 or x7 with a value less than 0.002, but in my plot i have a value less than 0.002

    Please see my curve result

    http://imageshack.us/photo/my-images/804/myplot.jpg/
    Last edited by 21did21; 2nd July 2011 at 01:42.

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

    Default Re: improve the auto scaling of axis

    Quote Originally Posted by 21did21 View Post
    So in my plot i can't have ...
    Of course you can - your debug code is wrong.

    Uwe

  4. #4
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default Re: improve the auto scaling of axis

    thank you for your answer, but i haven't understand it

    => if i put this condition (less than 0.002) so i shouldn't have a value less than this 0.002 in my plot

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

    Default Re: improve the auto scaling of axis

    C/C++ arrays start with index 0.

    Uwe

  6. #6
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default Re: improve the auto scaling of axis

    thank, but yes i know this but it don't resolve my problem

    i just put z=1 for the first loop because i don't want to plot first value
    Qt Code:
    1. for (int z=1;z<timeNb6;z++)
    To copy to clipboard, switch view to plain text mode 

  7. #7
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: improve the auto scaling of axis

    So where do you check the other values to make sure they are not < 0.002? You only check the [z][0] element.

    And do you clear all of your x, y arrays before pushing new data into them?

  8. The following user says thank you to d_stranz for this useful post:

    21did21 (7th July 2011)

  9. #8
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default Re: improve the auto scaling of axis

    my problem is solve:

    in fact, i did not clear vector before push. So now it's works nice

    thanks for your help

Similar Threads

  1. Replies: 3
    Last Post: 18th May 2011, 20:33
  2. Y axis not auto scaling
    By pkj in forum Qwt
    Replies: 0
    Last Post: 12th May 2011, 16:05
  3. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 01:12
  4. Scaling Painter without scaling the coordinate sytem
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2008, 21:30
  5. QLabel - auto font scaling possible?
    By Byngl in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2007, 16:50

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.