Rev 1411 | Rev 2330 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{}\title{Copy Graphics Between Multiple Devices}\usage{dev.control(displaylist)dev.copy(device, \dots, which=dev.next())dev.print(device=postscript, \dots)}\alias{dev.copy}\alias{dev.print}\alias{dev.control}\arguments{\item{device}{A device function (e.g., \code{x11}, \code{postscript},\ldots)}\item{\dots}{Arguments to the device function}\item{which}{A device number specifying the device to copy to}\item{displaylist}{A character string}}\description{\code{dev.copy} copies the graphics contents of the current device tothe device specified by \code{which} or to a new device which has beencreated by the function specified by \code{device} (it is an error tospecify both \code{which} and \code{device}).\code{dev.print} copies the graphics contents of the current device toa new device which has been created by the function specified by\code{device} and then shuts the new device. This is most useful forproducing a postscript copy from an on-screen device.\code{dev.control} allows the user to control the recording ofgraphics operations in a device. If \code{displaylist} is "inhibit"then recording is turned off.}\value{\code{dev.copy} returns the name and number of the device which hasbeen copied to.\code{dev.print} returns the name and number of the device which hasbeen copied from.}\note{Every device has a display list which records all ofthe graphics operations that occur in the device.\code{dev.copy} and \code{dev.print} copy graphicscontents by copying the display list from one device to another device.Also, automatic redrawing of graphics contents following the resizing ofa device depends on the contents of the display list.After the command \code{dev.control("inhibit")},graphics operations are not recorded inthe display list so that\code{dev.copy} and \code{dev.print} will not copy anything and thecontents of a device will not be redrawn automatically if the device isresized.The recording of graphics operations is relatively expensive in terms ofmemory so the command \code{dev.control("inhibit")} can be useful ifmemory usage is an issue.}\seealso{\code{\link{dev.cur}} and other \code{dev.xxx} functions}\examples{\dontrun{x11()plot(rnorm(10), main="Plot 1")dev.copy(device=x11)mtext("Copy 1", 3)dev.print(width=6, height=6, horizontal=F)dev.off(dev.prev())dev.off()}}\keyword{device}