Results 1 to 5 of 5

Thread: Draw Custom Y-Axis Labels

  1. #1
    Join Date
    Sep 2015
    Location
    Ontario, Canada
    Posts
    28
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Draw Custom Y-Axis Labels

    I have a plot that has the possibility of plotting many boolean values at once, so I've subclassed QwtSeriesData<QPointF> and added an offset if all the signals being plotted are booleans. However the y-axis won't show 0 for low now, and 1 for high (except on the single signal that doesn't get offset of course), but instead shows me <offset value> for low and <offset value + 1> for high.

    So I wanted to know how I could draw a custom y-axis so I can just have 0's and 1's repeated all the way up at <offset value> intervals or if there was an easier way to change the Y-axis labels.

    Thanks,
    TEAmerc

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

    Default Re: Draw Custom Y-Axis Labels

    I didn't get what you are doing. Is it about having several curves displaying boolean values, where you shifted the curves in vertical direction to avoid, that they are visually overlapping ?

    Uwe

  3. #3
    Join Date
    Sep 2015
    Location
    Ontario, Canada
    Posts
    28
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Draw Custom Y-Axis Labels

    Yes, that's exactly what I'm doing, and I wanted to know if there was a way I could change the y-axis to still show their true values even when they're shifted.

    Thanks,
    TEAmerc

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

    Default Re: Draw Custom Y-Axis Labels

    Then your question boils down to overloading QwtAbstractScaleDraw::label().

    Uwe

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

    TEAmerc (25th November 2015)

  6. #5
    Join Date
    Sep 2015
    Location
    Ontario, Canada
    Posts
    28
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Draw Custom Y-Axis Labels

    I got it working with that, thanks.

    TEAmerc

Similar Threads

  1. Qwt dynamic x axis labels
    By K4ELO in forum Qwt
    Replies: 4
    Last Post: 15th March 2013, 22:06
  2. QwtPlot axis labels
    By Kutuska in forum Qwt
    Replies: 7
    Last Post: 29th August 2012, 17:08
  3. Labels on axis.
    By eugene in forum Qwt
    Replies: 5
    Last Post: 6th August 2010, 14:30
  4. Replies: 1
    Last Post: 16th March 2010, 16:23
  5. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 10:26

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.