Results 1 to 6 of 6

Thread: Axis Tick and Label !

  1. #1
    Join Date
    Oct 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Axis Tick and Label !

    Hi All,

    I have 2 questions about the tick on the axis.

    1. When i disable the label on an axis (QwtPlot::xBottom), the tick at the maximum value of the axis doesn't display. Please look at the red rectangular of the image.
    Plottick.png

    2. How can i get the tick alignment like the red circles of the image?
    tickRotate.jpg

    Any help appreciated.

    Thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,258
    Thanked 862 Times in 811 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Axis Tick and Label !

    Is your question about how to align the ticks to the inner side of the plot ?

    Uwe

  3. #3
    Join Date
    Oct 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Axis Tick and Label !

    Quote Originally Posted by Uwe View Post
    Is your question about how to align the ticks to the inner side of the plot ?

    Uwe
    Hi Uwe,

    Yes, that's my second question.

    My first question is why the tick at the maximum value of the x axis doesn't display when i disable the label.

    Can you please give me any hint ?

    Thanks

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,258
    Thanked 862 Times in 811 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Axis Tick and Label !

    Quote Originally Posted by huyhoangfool View Post
    My first question is why the tick at the maximum value of the x axis doesn't display when i disable the label.
    In general I don't see a reason for this. Without running some code it is hard to say more.

    Uwe

  5. #5
    Join Date
    Oct 2011
    Posts
    9
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Axis Tick and Label !

    Quote Originally Posted by Uwe View Post
    In general I don't see a reason for this. Without running some code it is hard to say more.

    Uwe
    Hi Uwe,

    Thanks for response.
    The code is done as following:

    QwtPlot *myPlot = new QwtPlot;

    //Set Axis Scale
    myPlot->setAxisScale(QwtPlot::xBottom, 0, 12);
    myPlot->setAxisScale(QwtPlot::yLeft, 0, 120);

    //Set Axis Title, Set Max Minor, Medium, Major
    ...

    //Disable Label Component
    myPlot->axisScaleDraw(QwtPlot::xBottom)->enableComponent(QwtAbstractScaleDraw::Labels, false);
    When i use this line "myPlot->axisScaleDraw(QwtPlot::xBottom)->enableComponent(QwtAbstractScaleDraw::Labels, false);", the tick at the maximum value of x axis (value: 12) doesn't display.

    If i set the pen width of the ScaleDraw to 2, that tick will display. But, it's very ugly.
    hhhhh.png

    Thanks

  6. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,258
    Thanked 862 Times in 811 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Axis Tick and Label !

    Looks like a bug in the layout code of QwtScaleWidget to me. Maybe subtracting one pixel from length in QwtScaleWidget::layoutScale() is the necessary fix.

    Uwe

Similar Threads

  1. Add a starting value tick on axis
    By temis in forum Qwt
    Replies: 5
    Last Post: 4th July 2012, 12:48
  2. X axis tick label - font size
    By junhonguk in forum Qwt
    Replies: 5
    Last Post: 26th April 2012, 16:15
  3. Y Axis tick labels cut off on left
    By rbergeron in forum Qwt
    Replies: 2
    Last Post: 4th November 2011, 15:29
  4. Replies: 2
    Last Post: 29th September 2011, 14:10
  5. Replies: 1
    Last Post: 23rd June 2010, 10:20

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.