windows {base}R Documentation

Windows graphics devices

Description

A graphics device is opened. For win.graph, windows, x11 and X11 this is a graphics window on the current Windows display: the multiple names are for compatibility with other systems. win.metafile prints to a file and win.print to the Windows print system.

bringToTop brings the specified screen device's window to the front of the window stack (and gives it focus).

Usage

windows(width = 7, height = 7, pointsize = 12,
        record = getOption("graphics.record"),
        rescale = c("R", "fit", "fixed"))
win.graph(width = 7, height = 7, pointsize = 12)
x11(width = 7, height = 7, pointsize = 12)
X11(width = 7, height = 7, pointsize = 12)
win.metafile(filename = "", width = 7, height = 7, pointsize = 12)
win.print(width = 7, height = 7, pointsize = 12)

bringToTop(which = dev.cur())

Arguments

display indicates the purpose of the device.
filename the name of the output file: it will be an enhanced Windows metafile, usually given extension .emf or .wmf.
width the (nominal) width of the plotting window in inches.
height the (nominal) height of the plotting window in inches.
pointsize the default pointsize of plotted text.
record logical: sets the initial state of the flag for recording plots.
resize controls the action for resizing plots.
which a device number.

Details

All these devices are implemented as windows devices, the display parameter selects which is actually used.

The size of a window is computed from information provided about the display: it depends on the system being configured accurately.

A graphics window is not allowed to be specified at more that 85% of the screen width or height: the width and height are rescaled proportionally. The window can be resized to a larger size.

If the filename is omitted for a win.metafile device, the output is copied to the clipboard when the device is closed. A win.metafile device can only be used for a single page.

If a screen device is re-sized, the default behaviour is to redraw the plot(s) as if the new size had been specified originally. Using "fit" will rescale the existing plot(s) to fit the new device region, preserving the aspect ratio. Using "fixed" will leave the plot size unchanged, adding scrollbars if part of the plot is obscured.

A graphics window will never be created at more that 85% of the screen width or height, but can be resized to a larger size. For the first two rescale options the width and height are rescaled proportionally if necessary, and if rescale = "fit" the plot(s) are rescaled accordingly. If rescale = "fixed" the initially displayed portion is selected within these constraints, separately for width and height.

Using strwidth or strheight after a window has been rescaled (when using "fit") gives dimensions in the original units, but only approximately as they are derived from the metrics of the rescaled fonts (which are in integer sizes)

The displayed region may be bigger than the `paper' size, and areas outside the `paper' are coloured light grey. Graphics parameters such as "din" refer to the scaled plot if rescaling is in effect.

Value

A plot device is opened: nothing is returned to the R interpreter.

Author(s)

Guido Masarotto

See Also

Devices, postscript