Results 1 to 3 of 3

Thread: Updating plots

  1. #1
    Join Date
    Mar 2010
    Location
    Auckland, NZ
    Posts
    121
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Updating plots

    I set up a grid of timeseries QwtPlots like this:
    for (int i=0; i<nGraphs; i++) {
    mdiArea->addSubWindow(pGraph[i]);
    pGraph[i]->show();
    }
    As the program executes, at each time step the line plot is redrawn with the incremented number of data points. This all works fine. The only problem is that usually (but not always) the y axis title and/or y axis labels are truncated, as in the attached pic.
    Capture.jpg

    I'd like to know if there is a command to update or resize (whatever the right term is) the plots so that the axis title (if present) and the axis labels are visible.

    Thanks
    Gib

  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: Updating plots

    QwtPlot::updateLayout recalculates the geometries of the components of a plot.

    But well behaving children indicate relevant changes concerning their sizeHint by posting a QEvent::LayoutRequest to the parent, what leads in case of QwtPlot to calling updateLayout. Could you try to find out, why this is not happening in your situation ?

    Uwe

  3. #3
    Join Date
    Mar 2010
    Location
    Auckland, NZ
    Posts
    121
    Thanks
    9
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Updating plots

    Hi Uwe, thanks for the quick response.
    The only two factors I can think of are first that I am a primitive C++ programmer, and second that in many plots (I have a grid with 20 plots in 4 rows) the range of the y axis is constantly changing, sometimes increasing a lot. I have added a call to updateLayout after redraw, and all looks good now.
    I'm not sure how I'd go about tracking down the cause of bad child behaviour. Maybe you can make a suggestion. I am busy preparing for a presentation in a couple of days, so I will not have time to do much immediately.

    Gib

Similar Threads

  1. Replies: 3
    Last Post: 8th April 2013, 08:06
  2. multi plots
    By 21did21 in forum Qwt
    Replies: 7
    Last Post: 24th May 2011, 02:11
  3. qwt plots & inheritance
    By fatecasino in forum Qwt
    Replies: 1
    Last Post: 14th December 2010, 15:35
  4. Plots and Layouts
    By Ozzy in forum Qwt
    Replies: 5
    Last Post: 17th November 2009, 10:00
  5. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 14:43

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.