Results 1 to 4 of 4

Thread: auto rescaling

  1. #1
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question auto rescaling

    Hi Ive made a graph using qwt and its examples...
    I want to ask...is there any option to make it look the way that it displays axis only that long as many values it stores....I mean...Im displaying 23 values...but the X-axis are displayed to 25 value
    Plus max value of my graph is 10 and graph displays Y-axis to value 10 so I can barely see the plot...
    see the attachement picture...
    Attached Images Attached Images

  2. #2
    Join Date
    Sep 2007
    Posts
    99
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: auto rescaling

    ok so I didnt find out any answers even after searching the docs so Im gonna let this the way it is ...
    The only question is why does it scaling X:bottom Axis by by 5 ?
    Does anyone know how to set some kind of "factor" od scaling ?
    thanks

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: auto rescaling

    I don't have Qwt at hand, but AFAIR there was an example with automatic scale.

  4. #4
    Join Date
    Jan 2006
    Location
    Hannover, Germany
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: auto rescaling

    Well, let me try to explain. Each axis has a QwtScaleEngine, which calculates the scale. And if you have autoScale enabled, an automatic QwtScaleEngine is calculated depending on the range of your data, where the margins of the axis are rounded to "nice values", hence the 10 on your yAxis.
    If you do not like the autoScale values, you have to override autoScaling by explicitly calling QwtPlot::setAxisScale(int axisId, double min, double max, double step = 0).
    Your second question: You can set the number of ticks and/or labels with QwtPlot::setAxisMaxMajor(int axisId, int maxMajor) and QwtPlot::setAxisMaxMinor(int axisId, int maxMinor).

    HTH,
    Weilor

  5. The following user says thank you to Weilor for this useful post:

    gyre (18th December 2007)

Similar Threads

  1. Delete auto pointer from QMultiMap
    By phillip_Qt in forum Qt Programming
    Replies: 5
    Last Post: 3rd December 2007, 17:29
  2. QTextEdit auto resize
    By bunjee in forum Qt Programming
    Replies: 4
    Last Post: 26th October 2007, 19:59
  3. form not auto resizing
    By quickNitin in forum Newbie
    Replies: 5
    Last Post: 7th June 2007, 10:00
  4. Auto update module
    By munna in forum General Discussion
    Replies: 3
    Last Post: 26th September 2006, 14:52
  5. How disable auto spell checking
    By oashton in forum KDE Forum
    Replies: 1
    Last Post: 31st January 2006, 10:51

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.