It seems I’ve solved this issue based on this question. I am able to plot multiple plots like this:
plots = []
for (x, y) in ...
push!(plots, plot(x,y))
end
plot(plots...)
so the important part are the dots.
However, I tried to implement this with my example above,
using Plots
x = 1:10;
y = rand(10);
plot1 = bar(x, y);
plot2 = scatter(x, y);
plot([plot1, plot2, plot1, plot2]..., layout = 4)
and interestingly enough it shows only half of the plots! I tried to analyze further and found out that duplicate plots do not show in the final plot. See for example following snippet which shows an empty grid (no plots inside) for me:
x = 1:10;
y = rand(10);
plot1 = bar(x, y);
plot([plot1, plot1, plot1, plot1]..., layout=4)
Yes, thank you. I believe I just got confused when I couldn’t see the right output because it didn’t work for my testing code of the same plots repeated multiple times.