Results 1 to 6 of 6

Thread: Unexpected minor tick on QwtPlot x axis

  1. #1
    Join Date
    Oct 2017
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Unexpected minor tick on QwtPlot x axis

    I use QwtPlot to show a time series (i.e. I append a new point every 1" and the x axis autoscales).
    I set x axis with major ticks only (no minor ticks) and everything is ok for a while.
    After more or less 50", when I add a new point, one minor tick appears (at least its look-and-feel is the same as a minor tick) unexpectedly.
    This "minor tick" seems to be "attached" to the point and it scrolls together with the x axis.

    Do you have ideas on what is it?
    Is there a way to avoid it?

    I see the behavio with Qwt 6.1.3 under Windows.

  2. #2
    Join Date
    Oct 2017
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Unexpected minor tick on QwtPlot x axis

    Sorry for pushing.
    Can someone help with this behavior?

    Thanks

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

    Default Re: Unexpected minor tick on QwtPlot x axis

    Not much information to guess what is going on.
    A small compilable demo would help.

    Uwe

  4. #4
    Join Date
    Oct 2017
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Unexpected minor tick on QwtPlot x axis

    I try to do my best in the next few days to get a small example.
    In the meanwhile I can add some additional info and a screenshot.
    capture.PNG

    If you keep running the time series you see that the "artifact ticks" come in small groups of three of them.
    You can also see that their size is smaller than the size of the major tick, and the central one in longer than the two side ticks.
    But all of them are shorter than the major ticks.

    The number of these "groups of ticks" is 5, and 5 is the number of the major ticks I set.
    Even if I keep running the time series, after 5 groups no more artifact ticks appear.


    Maybe this can help, maybe it can't.
    Last edited by vix; 3rd January 2022 at 09:26.

  5. #5
    Join Date
    Oct 2017
    Posts
    25
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: Unexpected minor tick on QwtPlot x axis

    I've been able to find and fix this behavior.
    For some reasons (not 100% clear to me) during the creation of the QwtPlot the QwtScalDiv can be created with some predefined major, minor and medium ticks.
    Their values depend on the default value for the x scale, I think.

    And so I must explicitly delete all the minor and medium ticks, otherwise they will fit into visible scale (soon or later).

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

    Default Re: Unexpected minor tick on QwtPlot x axis

    The ticks will always be recalculated from scratch in QwtPlot::updateAxes - the call where the calculation happens is QwtScaleEngine::divideScale.
    Guess your code does changes behind the back of the plot, so that the necessary updates are not running ?

    Uwe

Similar Threads

  1. Axis Tick and Label !
    By huyhoangfool in forum Qwt
    Replies: 5
    Last Post: 29th July 2014, 12:20
  2. Add a starting value tick on axis
    By temis in forum Qwt
    Replies: 5
    Last Post: 4th July 2012, 11:48
  3. Replies: 1
    Last Post: 23rd June 2010, 09:20
  4. Axis Tick Labels Overlap
    By amoswood in forum Qwt
    Replies: 3
    Last Post: 8th June 2010, 15:52
  5. y-axis tick labels trimmed
    By gib in forum Qwt
    Replies: 2
    Last Post: 2nd April 2010, 05:19

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.