Results 1 to 3 of 3

Thread: Plot autoscale obscuring axis labels and title.

  1. #1
    Join Date
    Jun 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question Plot autoscale obscuring axis labels and title.

    Hi Folks -

    I have a plot that is being continuously updated with data pulled in from a serial port. As the values exceed the current Y-axis scale, the plot automatically scales and continues plotting correctly. However, as the axis values get larger they overwrite the axis title and then no longer fit themselves. Here is a picture of what happens (the Y-axis should also have a label that says "Count" but it has been covered up):



    If I resize the entire window while this is happening, it will redraw the axis correctly. Is there a way that I can redraw the plot axis programatically without re-sizing the entire application?

    Thanks much,

    Joe.

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

    Default Re: Plot autoscale obscuring axis labels and title.

    Quote Originally Posted by JoeBauman View Post
    Is there a way that I can redraw the plot axis programatically without re-sizing the entire application?
    Obviously the layout of your plot widget is not recalculated, what should happen each time the plot gets an QEvent::LayoutRequest event. So the question is why the plot widget gets no event, when your scales are changing. Please spend some time on finding out, what happens to this event in your environment ( Qwt/Qt versions ? ) or send me small demo, if you are using Qwt 6.x.

    As workaround you can post an QEvent::LayoutRequest event to the plot widget from your code ( QwtPlot::replot processes all pending layout requests ) or call QwtPlot::updateLayout() manually.

    Uwe

  3. #3
    Join Date
    Jun 2011
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Plot autoscale obscuring axis labels and title.

    Thanks for the reply, Uwe. I got pulled away on some other tasks and am just now looking at this again.

    I've added an updateLayout() call as a workaround, though I am going to look into the event system a bit as I think I might be seeing some other strange yet related behavior. I'll post here if I find any solutions.

Similar Threads

  1. How to hide axis labels
    By repepo in forum Qwt
    Replies: 5
    Last Post: 10th November 2011, 09:03
  2. Replies: 9
    Last Post: 3rd May 2011, 22:21
  3. axis autoscale: 2 user case scenarios
    By fatecasino in forum Qwt
    Replies: 1
    Last Post: 19th January 2011, 03:11
  4. Labels on axis.
    By eugene in forum Qwt
    Replies: 5
    Last Post: 6th August 2010, 14:30
  5. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 10: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.