Copy Graphics between Graphics Devices

DESCRIPTION:
Copy the current plot to other graphics devices.

USAGE:
dev.copy(device, ..., which = dev.next())
dev.print(device = postscript, ...)
dev.control("inhibit")

OPTIONAL ARGUMENTS:
device:
a graphics device function. Note that only one of which or device can be supplied.
...:
arguments to the graphics device.
which=:
an integer corresponding to an active graphics device.

VALUE:
the integer corresponding to the current graphics device and the name of that graphics device.

SIDE EFFECTS:
dev.copy starts a graphics device given by device or uses an active device given by which. It copies the current graph onto the new graphics device and sets this graphics device as the current device.

dev.print starts a graphics device given by device and copies the graph from the current graphics device onto this new graphics device then turns off the new graphics device.

dev.control allows you to turn off the internal display list kept for the current graphics device. This saves memory, but disables dev.copy and dev.print.


DETAILS:
dev.print is most useful when device is a hardcopy graphics device.

If you know you will not be using dev.print or dev.copy with the current graphics device, and you find that your plots are taking a lot of memory, you can use the S-PLUS expression dev.control("inhibit") after starting your device, and S-PLUS will not maintain a display list for the graphics device. If you want to turn the display list back on, you must restart the graphics driver. This internal display list contains a record of graphics done since the last time the drawing area was cleared, and is necessary for dev.print and dev.copy to work.


WARNING:
Do not use dev.copy or dev.print if you have inhibited the display list; the state of the graphics devices may get confused.

SEE ALSO:
Devices , dev.cur .

EXAMPLES:
X11()
tsplot(lynx, col=3)
dev.copy(device=X11, xcm.vlight)
title("The Copied Lynx Plot")
dev.print(postscript, command="lpr -dPost")