View Full Version : Lining up multiple plots

18th June 2008, 11:29
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:

plotLayout->addWidget(plot->axisWidget(QwtPlot::yLeft), row, 0);
plotLayout->addWidget(plot->canvas(), row, 1);

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?


19th June 2008, 19:23
This is one of the FAQs. F.e. read the following thread (http://www.qtcentre.org/forum/f-qwt-23/t-custom-axis-setaxisscaledraw-questions-11073.html).


20th June 2008, 00:25
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,