Julia plots layout

Hi everyone, I currently am working on a plot with 3 rows of plots, using layout = layout(3,1).
My issue is related to the x axis mismatch between the first diagram and the other 2; how should I fix it?

thankyou in advance!

A workaround is to draw blank legends of appropriate length:

using Measures, Plots; gr()

l = @layout [a{0.5h}; b{0.25h}; c]

p1 = plot(sin, label="sin", legend=:outertopright)
plot!(cos, label="cos")

p2 = plot(cosh, c=:red)
plot!([1],[NaN], label=" "^4, c=:white, legend=:outertopright, fg_legend=:transparent)

p3 = plot(atan, legend=false, c=:green)
plot!([1],[NaN], label=" "^4, c=:white, legend=:outertopright, fg_legend=:transparent)

p = plot(p1, p2, p3, link=:x, layout=l, margin=0mm)
for i=1:2; plot!(p[i],xformatter=_->""); end; p

NB:
Simplifed the xtick labels removal part using this solution from the master @tbreloff.

3 Likes