The patches attached to the ticket implement an API to set minimum axis size for a plot. This allows some control over the alignment of the plot canvas which is needed if one wants to have several synchronized plots (i.e. which display at the same X scale and offset).
Using minimum axis size is a crude approach because there's no limit on maximum axis size and thus the synchronized plots may still come out of alignment. An ideal solution would involve a separate "synchronizer" that would ensure that for each axis all subplots have axis size equal to the maximum axis size of the subplots. This would ensure proper alignment in all cases.
Anonymous
Patch for qwt-6.1 branch.
Patch for trunk.
Is the intention of this patch similar to the hacks you find in the plot matrix example ?
Yes. Thanks for pointing me to it, looks like the needed APIs already exist, so this patch can be dropped.
Do you think there's a chance to have a widget like this as part of official Qwt widget set?
Well it is a hack and is for a reason only available as example.
The problem is the strategy implemented in QwtPlotLayout, that starts with calculating the areas for scales/title/footer/legend first and giving the rest to the canvas. Having a second type of layout, that starts from the canvas ( finally accepting not filling the given rectangle completely ) would be the solution.
Such a layout would solve not only the problem of aligning plots, but also when the canvas needs to have a fixed aspect ratio ( yes QwtPlotRescale is a similar hack as the PlotMatrix ).