Results 1 to 8 of 8

Thread: xBottom Scale Overide

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default xBottom Scale Overide

    Hi All,

    How can i move scale 1 to the middle of 0 and 1?

    (explaination)
    I am plotting data from a sensor from each device ( say two devices in this case )

    so in my plot I use xBottom scale as my device number and made sure that all sensor points (data) from device 1 will stay in 0 to 1 tick in my plot, and the data from device 2 will be ploted in 1 to 2 tick.

    Now, I'd like to move the label to the middle of the block not at the edge. say number 1 the x scale should be drawn in between 0 and 1 tick.

    hoping you understand what i am talking about,

    baray98

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

    Default Re: xBottom Scale Overide

    You want a label for the interval, not for a position ( on my TODO list since some time ). This is not possible with Qwt 5.x, but you can implement the following workaround:

    With QwtPlot::setAxisScaleDiv you can assign scales with irregular tick positions. The labels are always below the major ticks.
    Assign minor ticks at 0 and 1 and a major tick at 0.5. Then set the tick length for major ticks to 0 and increase the tick length for the minor ticks ( QwtScaleDraw::setTickLength() ).

    HTH,
    Uwe

  3. #3
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: xBottom Scale Overide

    Assign minor ticks at 0 and 1 and a major tick at 0.5.
    Can you give a little snippets on how to do this on QwtScaleDiv. I did not really understand it

    My devices are actually 128 and each devices will have a max sensor of 48. If there is a little something that i can start with QwtScaleDiv then I can figure out the rest.

    baray98

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

    Default Re: xBottom Scale Overide

    Its a class with the min/max values of your scale and 3 arrays with the values, where the ticks are. Nothing that could be misunderstood.

    Uwe

  5. #5
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: xBottom Scale Overide

    Hi Uwe,

    I got it running on single plot but when i tried to incorporate it to the "plot matrix" example where , x axis are sycnhronize, it did somehow went back ot its regular ticks. This only happens when i would play with the setAxisScale or change the axisScale on xBottom of the matrix.

    Any hint of whats going on ? whos putting the regular ticks back?

    baray98

    p.s. thank you very much for your help

  6. #6
    Join Date
    Dec 2010
    Location
    Israel
    Posts
    90
    Thanks
    59
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: xBottom Scale Overide

    I have a related question, on the same subject:

    I can't seem to locate QwtScaleDraw::setTickLength() in the documentation and I also didn't understand the suggested use of this method as you described it.

    Could anyone please explain what that method can be used for and how?

  7. #7
    Join Date
    Oct 2009
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: xBottom Scale Overide

    how to getaxis scaling range.
    i want to get the min and max range of the x-axis .How can we do that?

  8. #8
    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: xBottom Scale Overide

    Don't ask a new question in an existing thread. Start a new one.

    To answer your question:

    Qt Code:
    1. double axisLeft = plot->axisScaleDiv( QwtPlot::xBottom )->lBound();
    2. double axisRight = plot->axisScaleDiv( QwtPlot::xBottom )->hBound();
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Qwt Scale Draw
    By maxpayne in forum Qwt
    Replies: 2
    Last Post: 6th June 2012, 13:01
  2. Y-Axis Scale Spacing - Newbie Question
    By Rick108 in forum Qwt
    Replies: 3
    Last Post: 13th October 2009, 08:20
  3. Replies: 0
    Last Post: 6th March 2009, 08:19
  4. Apply different scale on items
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2009, 06:59
  5. Replies: 13
    Last Post: 12th June 2008, 13:23

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.