Plotting several series in a same plot display is possible and also several subplots in a display. But I want several plots which can be completely different things (not necessarily a series or graph of a map) to be displayed exactly in one frame. How can I do that? In Maple you assign names for each plot like
P1:=...:, P2:= ...: and then using plots:-display(P1,P2,...); and it works. But I want to do this in Julia. Let's say I have the following plots as an example;
using Plots
pyplot()
x=[1,2,2,1,1]
y=[1,1,2,2,1]
plot(x,y)
p1=plot(x,y,fill=(0, :orange))
x2=[2,3,3,2,2]
y2=[2,2,3,3,2]
p2=plot(x2,y2,fill=(0, :yellow))
Now how to have both P1 and P2 in one plot? I don't one a shortcut or trick to write the output of this specific example with one plot line, note that my question is general, for example p2 can be a curve or something else, or I may have a forflow which generates a plot in each step and then I want to put all those shapes in one plot display at the end of the for loop.
Code for a simple example of trying to use plot!() for adding to a plot with arbitrary order.
using Plots
pyplot()
x=[1,2,2,1,1]
y=[1,1,2,2,1]
p1=plot(x,y,fill=(0, :orange))
x2=[2,3,3,2,2]
y2=[2,2,3,3,2]
p2=plot!(x2,y2,fill=(0, :orange))
p3=plot(x,y)
display(p2)
p5=plot!([1,2,2,1,1],[2,2,3,3,2],fill=(0, :green))
By running the above code I see the following plots respectively.

But what I expected to see is a plot with the green rectangle added inside the plot with the two orange rectangles.
plot!()works. But there is one drawback aboutplot!(), and that is this way you add the current plot to the last previous plot. So it forces you to necessarily have the plots that you want to be printed in the same frame exactly after each other. While the method in Maple give you the freedom to define plots and then you can have any combination of them wherever in the program that you want. Is there by any chance any other command in Plots package of Julia or any other plotting package of Julia that gives such a freedom? - AmirHosein Sadeghimaneshplot()by default display the latest plot made.. - AntonelloP2beforeP4=plot!(), it is still addingP4toP3. Maybe I'm doing something wrong otherwise it seemsplot!()is only adding to the last new plot. - AmirHosein Sadeghimanesh