Device: The Device class

Description Usage Arguments Details Value Fields and Methods Author(s) See Also Examples

Description

Package: R.graphics
Class Device

Object
~~|
~~+--Device

Directly known subclasses:

public static class Device
extends Object

A class for creating graphical devices, plotting to them etc.

Usage

1
Device(filename=NA, restore.parameters=FALSE)

Arguments

filename

A filename where to save the resulting plot. The filename suffix decides what graphical device driver will used. By default the screen will be used.

restore.parameters

Some graphical device drivers might change the global graphical parameters (see par()). dev.open() can restore them automatically if this argument is TRUE. Default value is FALSE since querying for graphical parameters opens up an annoying empty window if no window is opened.

Details

To set eps/ps or xfig options use .Postscript.Options (see help(.Postscript.Options)). To set bitmap arguments (bmp, jpg/jpeg, png and gif) use .Bitmap.Options. To set default pictex arguments (tex/pictex) use .PicTeX.Options.

Supported devices are screen, eps, ps, bmp, jpg/jpeg, png, tex/pictex, xfig and gif. The gif device requires that ImageMagick (http://www.imagemagick.org/) is installed on the system path. To test if it is installed try system("convert").

Value

The constructor returns a Device object.

Fields and Methods

Methods:

bringToTop Bring a device to top.
callFunction -
choose GUI figure selector.
close Closes the device.
closeAll Closes all open devices.
constructor -
finalize -
findPngDevice Searches for a working PNG device.
getAspectRatio -
getDimensions -
getMouseClick -
getNext Opens the next device.
getOptions Get the current default options for a given device type.
getParameters Gets parameters specific to a certain type of device.
getPlotParameters -
getPrintPath Gets the current path where figures are saved.
isOpen Checks if a device is open or not.
new Creates a new device.
open Opens a device.
plotRegions Static method plotting information about the different regions of a device.
plotSymbols Display available plot symbols.
print Prints device to file.
putAuthor -
putDataset -
putTimestamp -
resetOptions Reset the current default options for a given device type.
set Sets the current device index.
setOptions Set the current default options for a given device type.
setPlotParameters -
setPrintPath Sets the current path where figures are to be saved.
setStyle Sets plot style for the current device.
subplots Creates a grid of subplots.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, gc, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, objectSize, print, registerFinalizer, save

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

Internally the bmp, jpeg, pictex, png, postscript, xfig in the grDevices package, and the gif() in this package, and eps().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
   dev <- Device("myplot.eps")
   plot(1,1)
   dev$close()
 
   # and similar...
   plot(1,1)
   Device$print("myplot.eps")
 
## End(Not run)

HenrikBengtsson/R.graphics documentation built on May 6, 2019, 11:53 p.m.