One often wants to display multi-channels data. ie: data from different sources/sensors (with different Y scales), but all sharing the same X scale. Doing this with qwt is not trivial. It took me a lot of tries before I could do it, so it probably makes sense to do a post here to let people know how to achieve that.

The major problem is to have all Y scales be drawn with the same width, so that data remains aligned with a common X-scale displayed at the bottom of the view.

The best way to do this is to use PlotMatrix from qwt 6.0 examples (working with earlier versions of qwt with minor changes).
plotmatrix.jpg

- Set QGridLayout used by this class margins and space to 0
- Add scaleWidget->setMinimumWidth( maxExtent ); after scaleWidget->scaleDraw()->setMinimumExtent( maxExtent ); in the last for loop in PlotMatrix::alignVAxes
- Change if ( p ) p->replot(); to if ( p && p->autoReplot() ) p->replot(); in PlotMatrix::updateLayout() to prevent replottings (time consuming)

Then, you may obtain that:
multichan.jpg

Note: I found one bug so far:
- If legends are displayed on two lines (using \n) for some channels and one line for others, Y scales are not aligned anymore:
multichan2.jpg