Results 1 to 2 of 2

Thread: Refresh axis scale drawing

  1. #1
    Join Date
    Apr 2008
    Posts
    53
    Thanks
    10

    Default Refresh axis scale drawing

    Hi, I'm redrawing the scales on qwtPlot each time a user checks a button using QwtScaleDraw, but how do I refresh the axis scale drawing (or how do I get label() to be called?) I tried d_plot->replot(), d_plot->updateAxes(); but the axis labels did not change until i either zoom or pan the plot.

    Thank you

    Qt Code:
    1. class LatLonScaleDraw: public QwtScaleDraw
    2. {
    3. public:
    4. LatLonScaleDraw() {}
    5.  
    6. virtual QwtText label(double v) const
    7. {
    8. if (...)
    9. return (QString::number(v));
    10. else
    11. return (QString::number(v/2));
    12. }
    13. };
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Refresh axis scale drawing

    QwtAbstractScaleDraw caches the tick labels. You can invalidate the cache with QwtAbstractScaleDraw::invalidateCache().

    Uwe

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

    embeddedmz (15th July 2019)

Similar Threads

  1. Replies: 1
    Last Post: 19th May 2009, 11:14
  2. qwp plot axis scale
    By Cal in forum Qwt
    Replies: 1
    Last Post: 11th May 2009, 17:10
  3. Axis with a probability scale
    By Lister in forum Qwt
    Replies: 1
    Last Post: 5th May 2009, 06:45
  4. Axis won't stay at new scale setting
    By Maxicatten in forum Qwt
    Replies: 5
    Last Post: 9th April 2009, 04:03
  5. 4 axis auto scale..
    By Vincenzo in forum Qwt
    Replies: 0
    Last Post: 22nd March 2009, 01:12

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.