Layout with several grids

I am using Plots with GR backend and trying to create a 2x2 grid of plots with a common legend in the bottom.

As it happens, there is no support for horizontal legends with gr, so I am trying to add plots without a frame below my 2x2 grid. Since each subplot has 5 curves, I want to split the legend into 3 columns.

In principle, I am trying to specify the layout which looks like

@layout [grid(2,2)

Now, how do I specify the relative heights of the upper and lower grids?

It seems that horizontal legends are supported by GRUtils.jl. Is there a way to mix Plots.jl and GRUtils.jl?

Horizontal legends are now supported since Plots@1.36.0 for the GR backend.

A long standing wished for feature (Horizontal legends · Issue #2206 · JuliaPlots/Plots.jl · GitHub).

EDIT: and now for PyPlot as well.

1 Like

Like this:

@layout [grid(2,2){0.7h}; grid(1,3)]