Results 1 to 8 of 8

Thread: QwtPlot axis labels

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlot axis labels

    This is your code:

    Qt Code:
    1. class YourScaleDraw: public QwtScaleDraw
    2. {
    3. public:
    4. virtual QwtText label( double v ) const
    5. {
    6. return QwtScaleDraw::label( pcmToMS( v ) );
    7. }
    8. };
    9.  
    10. plot->setAxisScaleDraw( ..., new YourScaleDraw() );
    To copy to clipboard, switch view to plain text mode 

    If you want to have ticks aligned to ms values read my first answer or set your ticks manually ( what is no option if you want to offer a navigation like zooming/panning to your users ) with QwtPlot::setAxisScaleDiv().

    HTH,
    Uwe

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

    Kutuska (29th August 2012)

Similar Threads

  1. How to hide axis labels
    By repepo in forum Qwt
    Replies: 5
    Last Post: 10th November 2011, 08:03
  2. QWTPlot x-axis labels with float spacing
    By Pyquestor in forum Qt Programming
    Replies: 0
    Last Post: 12th May 2011, 13:40
  3. Labels on axis.
    By eugene in forum Qwt
    Replies: 5
    Last Post: 6th August 2010, 13:30
  4. Replies: 1
    Last Post: 16th March 2010, 15:23
  5. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 09:26

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
  •  
Qt is a trademark of The Qt Company.