source("http://macosa.dima.unige.it/r.R")    # If I have not already loaded the library
---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
S 17 Multiple graphs (in the same window)
 
rowcol(2,3)      # or:   colrow(3,2)
BoxW(0,6,0,6); BOX(); stepline(x,y, "blue"); BoxW(0,6,0,6); stepl(x,y, "blue")
Box_(0,6,0,6); polyline(x,y, "brown"); Box_(0,6,0,6); polyli(x,y, "seagreen")
Boxm_(0,6,0,6); POINT(x,y, "red"); Box_(0,6,0,6); POINT(x,y, "blue")

 

rowcol(m,n) [or colrow(n,m)]  predisposes to make graphs in a multiple window (m rows,
                              n columns)
Box_  opens a subwindow, and leaves the margins
Boxm_  opens a monometric subwindow, and leaves the margins

BoxW  opens a subwindow without leaving the margins [and without grid - if I want it I
BoxmW  opens a monometric subwindow without leaving the margins             use BOX()]

BoxWW  opens a subwindow leaving little margins [and without grid - if I want it I
BoxmWW  opens a monometric subwindow leaving little margins             use BOX()]

BoxW_  opens a subwindow leaving the margins, without grid - if I want it I use BOX()
BoxmW_ opens a monometric subwindow leaving ...

stepline  does not connect the "y"
stepl  like stepline, with thin lines

Another example:

rowcol(2,3)
Box_(0,6,0,6); stepline(x,y, "blue"); Box_(0,6,0,6); stepl(x,y, "blue")
Box_(0,6,0,6); polyline(x,y, "blue"); Box_(0,6,0,6); polyl(x,y, "blue")
Box_(0,6,0,6); polyli(x,y, "blue"); Box_(0,6,0,6); POINT(x,y, "blue")

 
Another:
 
dev.new(width=5, height=4); rowcol(3,1)           # for dev.new see
a=0; b=15; c=-2; d=2
f = function(x) 0.6*sin(x-pi/2); g = function(x) 1.2*sin(2*x+pi/2); h = function(x) f(x)+g(x)
BoxWW(a,b, c,d); BOX(); graph2(f,a,b, "blue")
abovex("f(x)+0.6*sin(x-pi/2)"); underX(c(0,5,10,15),c(0,5,10,15) ); underY(c(-2,0,2),c(-2,0,2) )
BoxWW(a,b, c,d); BOX(); graph2(g,a,b, "red")
abovex("g(x)=1.2*sin(2*x+pi/2)"); underX(c(0,5,10,15),c(0,5,10,15) ); underY(c(-2,0,2),c(-2,0,2) )
BoxWW(a,b, c,d); BOX(); graph1(f,a,b, "blue"); graph1(g,a,b, "red"); graph(h,a,b, "brown")
abovex("f+g"); underX(c(0,5,10,15),c(0,5,10,15) ); underY(c(-2,0,2),c(-2,0,2) )
for(x in pi*(1:5)) POINT(x,0,"black"); text(pi,-1/2,bquote(pi))

           

Other here (to operate simultaneously on multiple windows) or here
 
       

Other examples of use