# sendimage.R
#
# wrapper to sendPlot.R for a single, interactive image
#
sendimage <- function(plot.call,
x, y, z,
z.value="value",
x.lbls = NA,y.lbls=NA,xy.lbls=NA,
x.links=NA, y.links=NA,
xy.links=NA,asLinks=NA,
mai=NA,mai.prc=FALSE,
plt.extras=NA,
bound.pt=FALSE, source.plot=NA,
paint=FALSE, img.prog=NA,
resize="800x1100",
ps.paper="letter",ps.width=8,ps.height=11,
fname.root="test",dir="./",header="v2",
up.left=c(188,103),low.right=c(648,912),
spot.radius=5,automap=FALSE, automap.method="mode"
){
cat("NOTE: sendimage function is deprecated\n Please see imagesend \n\n\n")
# check plot call length -- this is wrapper for single plot
if(length(plot.call)>1){
cat("NOTICE: you have chosen a wrapper for a single plot.\n The first plot call in plot.calls will be used \n Additional plotting arguments, i.e. points, lines, abline, axes, should be placed in plt.extras \n ")
plot.calls = plot.call[1]
}
plot.calls = plot.call
# single plot - make matrix of ones for layout
mat = matrix(rep(1, 170), ncol=10, nrow=17)
# if margins are specified use default
if(is.na(mai[1])){
mai.mat = NA
}else{
mai.mat = matrix(mai, ncol=4)
}
# additional plot calls (i.e. axes, points, lines, abline)
# put into correct format
if(length(plt.extras)>1){
plt = list()
plt.idx = 1
for(i in 1:length(plt.extras)){
plt[plt.idx] = plt.extras[i]
plt.idx = plt.idx + 1
}
plt.extras = list()
plt.extras$plot1 = plt
}
# run sendplot using default or set arguments
sendplot(mat = mat, plot.calls = plot.calls, mai.mat = mai.mat ,mai.prc=mai.prc, type="image",x = x, y = y,z=z, z.value=z.value, plt.extras=plt.extras, x.lbls = x.lbls,y.lbls = y.lbls,xy.lbls = xy.lbls,x.links=x.links,y.links=y.links,xy.links=xy.links,asLinks=asLinks,bound.pt=bound.pt,resize=resize, ps.paper=ps.paper,ps.width=ps.width,ps.height=ps.height,fname.root=fname.root,dir=dir, paint=paint,source.plot=source.plot, img.prog=img.prog,up.left=up.left,low.right=low.right,spot.radius=spot.radius, header=header, automap=automap, automap.method=automap.method)
}# end sendimage
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.