With apologies for being sightly offtopic, here’s how to do it with Gaston, which is also based on gnuplot. Each plot is identified by a handle, which all
plot commands take as an optional argument (default is most recent plot):
x = collect(-1:0.1:1)
plot(x, x.^2, w = "l lw 2 lc 'red' t 'quadratic'", handle = 1)
plot(x, x.^3, w = "l lw 2 lc 'green' t 'cubic'", handle = 2)
plot!(x, x.^4, w = "l lw 2 lc 'blue' t 'quartic on top of 1'", handle = 1)
plot!(x, x.^4, w = "l lw 2 lc 'blue' t 'quartic on top of 2'", handle = 2)
Another difference between Gnuplot.jl and Gaston is that, in this example, Gnuplot.jl will start two gnuplot processes, whereas Gaston relies on a single process.