1
$\begingroup$

I'm trying to produce a vertical grid of plots sharing the same 'x' axis. I do it this way:

Plot1 = Plot[x, {x, 0, 1}, PlotTheme -> "Scientific"];
Plot2 = Plot[x^2, {x, 0, 2}, PlotTheme -> "Scientific"];

JointPlot = {{Plot1}, {Plot2}}

ResourceFunction["PlotGrid"][JointPlot, Spacings -> {0, 0}]

Grid of plots with both panels with the same height. I aim to have the upper panel bigger than the lower one.

I'm aiming to achieve the top panel being bigger than the bottom panel, i.e. to increase the top panel height and reduce the bottom panel height. An example can be the following figure:

Example of a Grid of Plots with panels with unequal heights.

I tried 'AspectRatio', but that affects to both panels in the figure, even though I only apply it to one.

Any suggestions? Thank you in advance

$\endgroup$

1 Answer 1

3
$\begingroup$

Try this:

Plot1 = Plot[x, {x, 0, 1}, PlotTheme -> "Scientific"];
Plot2 = Plot[x^2, {x, 0, 2}, PlotTheme -> "Scientific"];

ResourceFunction["PlotGrid"][{{Plot1}, {Plot2}}, Spacings -> {0, 0}, 
 ItemSize -> {Automatic, {1 -> 2}}]

with the following effect:

enter image description here

Have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.