Menu

#68 Add API to set minimum axis sizes for plot layout

None
closed
nobody
None
5
2019-06-21
2019-05-23
No

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.

Discussion

  • Uwe Rathmann

    Uwe Rathmann - 2019-06-20

    Is the intention of this patch similar to the hacks you find in the plot matrix example ?

     
    • Anonymous

      Anonymous - 2019-06-20

      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?

       
  • Uwe Rathmann

    Uwe Rathmann - 2019-06-20

    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 ).

     
  • Uwe Rathmann

    Uwe Rathmann - 2019-06-21
    • status: open --> closed
    • Group: -->
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB