I’ve been using Plots.jl for some time, but never managed to figure out the correct way of producing a figure with subplots and axis labels. In most cases, it seems axis labels are positioned outside of the plot area, and when joining the figures these get cut out.
MWE:
function plot_bug()
xs = [0, 1]
p1 = plot(xs, xs, xlabel="x1", ylabel="y1", title="A")
p2 = plot(xs, 1 .- xs, xlabel="x2", ylabel="y2", title="B")
p = plot(p1, p2, layout=(1,2), size=(1300,400))
savefig(p, "bug.pdf")
end
Result:
Removing the size directive “fixes” the labeling, but then the figure would not be in the correct scaling for what I need.

