Results 1 to 6 of 6

Thread: How to hide axis labels

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Platforms
    Unix/X11

    Default How to hide axis labels

    hi, is there a way to hide the tick labels (without hiding the ticks) from a plot? I can change their orientation with

    setAxisLabelRotation(Qwt.QwtPlot.xBottom, -90)

    and everything else but I don't know how to make them invisible... this is for a real time plotter and the labels are distracting/unnecessary. Suggestions are very welcome thanks!

  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: How to hide axis labels

    Qt Code:
    1. plot->axisScaleDraw( ... )->enableComponent(
    2. QwtAbstractScaleDraw::Labels, false );
    To copy to clipboard, switch view to plain text mode 
    Uwe

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

    chriskon149 (10th November 2011)

  4. #3
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Platforms
    Unix/X11

    Default Re: How to hide axis labels

    Thank you so much Uwe!

    p.s. I should have mentioned that I am using PyQt4.Qwt5. Just for reference, the actual python code I ended up using, based on Uwe's help is

    Qt Code:
    1. import PyQt4.Qwt5 as Qwt
    2.  
    3. class MyPlotClass(QMainWindow):
    4. ...
    5. def create_plot(self):
    6. plot = Qwt.QwtPlot(self)
    7. ...
    8. plot.axisScaleDraw(Qwt.QwtPlot.xBottom).enableComponent( \
    9. Qwt.QwtScaleDraw.Labels, False)
    To copy to clipboard, switch view to plain text mode 

  5. #4
    Join Date
    Aug 2011
    Location
    California, USA
    Posts
    24
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to hide axis labels

    I'm currently trying to do the same thing with Qwt in Qt (using C++), but I'm having issues. My error says "invalid use of incomplete type 'struct QwtScaleDraw'".

    How can I fix this error?

    Thanks!

    Chris

  6. #5
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to hide axis labels

    have you included the header file?

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

    chriskon149 (10th November 2011)

  8. #6
    Join Date
    Aug 2011
    Location
    California, USA
    Posts
    24
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to hide axis labels

    FelixB,

    That fixed it! Wow.... That was my bad for forgetting to do that, but thanks for catching it!

    Chris

Similar Threads

  1. Labels on axis.
    By eugene in forum Qwt
    Replies: 5
    Last Post: 6th August 2010, 14:30
  2. Axis Tick Labels Overlap
    By amoswood in forum Qwt
    Replies: 3
    Last Post: 8th June 2010, 16:52
  3. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 10:26
  4. Histogram axis labels as text
    By DKGear in forum Qwt
    Replies: 1
    Last Post: 30th December 2008, 09:54
  5. Relocating axis labels
    By malcom2073 in forum Qwt
    Replies: 0
    Last Post: 9th May 2008, 14:01

Tags for this Thread

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.