Load Library
library(sendplot)
Set up data
mat = matrix(c(rep(c(rep(4,8),rep(0,5)),2),
                         rep(c(rep(1,8),rep(3,5)),6),
                         rep(c(rep(2,8),rep(3,5)),4)),
                         byrow=T, ncol=13)
mai.mat = matrix(.5,ncol=4,nrow=4)
myX = c(-1,-10,1,10,-5,0)
plot.calls = c("boxplot(count ~ spray, data = InsectSprays, col = 'lightgray')",
                      "plot(1:3,1:3, col='blue', xlab='', ylab=''); points(1:2, 2:3, col='red')",
                      "image(1:2,1:3, z=matrix(myX,ncol=3,nrow=2), xlab='', ylab='')",
                      "plot(cos, xlim = c(-pi,3*pi), n = 1001, col = 'blue', xlab='', ylab='')" )
plt.extras = list(figure1= "rect(xleft=c(3,1), ytop=c(25,5),xright=c(4,2), ybottom=c(20,0));title(main='A', cex=3)",
                        figure2="polygon(x=c(2,2.5,3,2.5), y=c(1,2.5,1,1.5));title(main='B', cex=3)",
                        figure3 ="title(main='C', cex=3)",
                        figure4="title(main='D', cex=3)")
Initialize Splot Object
Splot = initSplot(mat, plot.calls, mai.mat = mai.mat,plot.extras =plt.extras)