Results 1 to 6 of 6

Thread: Labels on axis.

  1. #1
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1

    Default Labels on axis.

    Hello. How I can change frequency of labels drawning on axis? (Example in attachment)
    Attached Images Attached Images

  2. #2
    Join Date
    Apr 2008
    Posts
    32
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Labels on axis.

    I think that you should set your own scalediv with your own ticks. As far as I know visble values of scale are - majorTicks. So majorTick values should be [1,2,3,4...] and minorTicks - [0.5,1.5,...]

  3. #3
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1

    Default Re: Labels on axis.

    I tried this code, but has no effect. What do I wrong?
    Qt Code:
    1. QwtScaleDiv scaleDiv;
    2. QwtValueList vList;
    3. vList<<1<<2<<3<<4<<5;
    4. scaleDiv.setTicks(QwtScaleDiv::MajorTick,vList);
    5. setAxisScaleDiv(xBottom,scaleDiv);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    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: Labels on axis.

    Quote Originally Posted by eugene View Post
    I tried this code, but has no effect. What do I wrong?
    A QwtScaleDiv is more than its ticks - at least you have to set a valid interval.
    The rest of this code snippet looks o.k. for me.

    Uwe

  5. #5
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    1

    Default Re: Labels on axis.

    How I can get this intervals and set they? I cant understand this, because documentation of Qwt very poor, and I don't have any examples about this. I tried code from this topic http://www.qtcentre.org/threads/3254...-in-the-middle but also has no effect.

  6. #6
    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: Labels on axis.

    How I can get this intervals ...
    Maybe [1-5], but what do I ( or anybody else beside you ) know about the interval you want to have displayed on your axis ?
    ... and set they?
    QwtScaleDiv::setInterval(). The docs might be weak, but ...
    I cant understand this, because documentation of Qwt very poor, ...
    QwtScaleDiv stores the min/max values of a scale and the positions of its ticks. What else needs to be understood ?

    But is setting the ticks manually really what you want you to do - I guess instead you want to use the scale engine that is responsible for calculating the ticks configured, so that you get major ticks at each integer number: for this you have to play with the step parameter in QwtPlot::setAxisScale or with QwtPlot::setAxisMaxMajor().

    Uwe

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

    eugene (16th August 2010)

Similar Threads

  1. Axis Tick Labels Overlap
    By amoswood in forum Qwt
    Replies: 3
    Last Post: 8th June 2010, 15:52
  2. y-axis tick labels trimmed
    By gib in forum Qwt
    Replies: 2
    Last Post: 2nd April 2010, 05:19
  3. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 09:26
  4. Histogram axis labels as text
    By DKGear in forum Qwt
    Replies: 1
    Last Post: 30th December 2008, 08:54
  5. Relocating axis labels
    By malcom2073 in forum Qwt
    Replies: 0
    Last Post: 9th May 2008, 13:01

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.