Results 1 to 3 of 3

Thread: Lining up multiple plots

  1. #1
    Join Date
    Jun 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Lining up multiple plots

    I'm trying to display multiple plots in a column, which all have the same x-scale. However they have different data and different y-scales. This causes the yLeft axis widget to be different sizes, so the plots no longer line up.

    To make them line up, I decided to pull out the individual widgets and put them in my own QGridLayout, as follows:
    Qt Code:
    1. plotLayout->addWidget(plot->axisWidget(QwtPlot::yLeft), row, 0);
    2. plotLayout->addWidget(plot->canvas(), row, 1);
    To copy to clipboard, switch view to plain text mode 
    where plot is a QwtPlot, and plotLayout is a QGridLayout.

    When I do this, I get a segfault somewhere in QwtPlotCanvas::drawContents().

    My questions are:
    • Should this work, and I'm doing something somewhere else which screws up the canvas?
    • Is pulling the widgets out like this a bad thing to do, but there's another way to get my desired result?


    Thanks,
    -Joel

  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: Lining up multiple plots

    This is one of the FAQs. F.e. read the following thread.

    Uwe

  3. #3
    Join Date
    Jun 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Lining up multiple plots

    Thanks a lot.
    Apparently I was searching for the wrong keywords.

    Is there a collection of those frequent questions anywhere? It's not on the qwt website, and the FAQ on this site doesn't have anything qwt specific. (and a quick googling for "qwt faq" doesn't return anything useful).

    Thanks again,
    -Joel

Similar Threads

  1. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 14:43
  2. Replies: 4
    Last Post: 25th October 2007, 13:23
  3. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 06:23

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.