psxy <- function(x, cmd="-J -R -Scp -W2p -O -K", file=getOption("gmt.file"))
{
if(is.null(file))
stop("please pass a valid 'file' argument, or run gmt(file=\"myfile\")")
owd <- setwd(dirname(file)); on.exit(setwd(owd))
tmp <- paste(dirname(tempdir()), "xy.gmt", sep="/")
r2gmt(x, tmp)
gmt.system(paste("gmt psxy",tmp,cmd), file=file, append=TRUE)
invisible(NULL)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.