haskell-chart icon indicating copy to clipboard operation
haskell-chart copied to clipboard

Subplots alignment

Open EvgenyNerush opened this issue 6 years ago • 6 comments

Is there a way to align axes size in subplots? Namely, I use the following code gridToRenderable $ above (beside subplotA subplotB) (beside subplotC subplotD) in order to draw this figure: image I would like to have the same size of vertical axes in all plots, and the same size of all horizontal axes. Is it possible to achieve?

EvgenyNerush avatar Mar 26 '18 20:03 EvgenyNerush

P.S. Could you, please, comment on my pull request https://github.com/timbod7/haskell-chart/pull/176 . What is wrong with it (it works fine on my machine)?

EvgenyNerush avatar Mar 26 '18 20:03 EvgenyNerush

Can you describe what you mean be "align axes sizes" ? Do you want axes to show the same numeric ranges, or just occupy consistent physical space on the page?

timbod7 avatar Mar 26 '18 21:03 timbod7

I meant the same size in pixels ("occupy consistent physical space on the page"). E.g., almost all z-axes in Fig. above have the same numeric ranges, but different sizes. This looks not good.

EvgenyNerush avatar Mar 28 '18 10:03 EvgenyNerush

I understand - currently in your example the plot area is what remains after area has been alllocated to axes, legends and titles. If the space taken by these are inconsistent, the the different plot areas will not be the same.

A layout algorithm is required that ensures that all axes are given the same space, titles the same space, etc so the plot areas are consistently sized. Such an algorithm exists for a vertical stack of plots (see https://hackage.haskell.org/package/Chart-1.8.3/docs/Graphics-Rendering-Chart-Layout.html#t:StackedLayouts) but not currently for a grid of plots.

timbod7 avatar Mar 28 '18 11:03 timbod7

@EvgenyNerush Hi, would you mind sharing your code to produce your graphs? I'm having trouble resizing mine and you seem to have completely mastered it

Magalame avatar Jan 03 '19 12:01 Magalame

What code do you mean exactly? The code for the figure above is quite complicated and requires some additional libs. If you mean just some curves in four subplots with some fontsize etc., I can give an example.

EvgenyNerush avatar Jan 06 '19 22:01 EvgenyNerush