Learn R Programming

gWidgets (version 0.0-25)

ggraphics: Constructor for a toolkit specific plot device and a notebook to wrap plots in

Description

If a toolkit provides a graphics device, such as the cairoDevice package does for GTK, this constructor makes devices that can then be embedded in other widgets. The notebook interface is one such example.

Usage

ggraphics(width = dpi * 6, height = dpi * 6, dpi = 75, ps = 12, container =
NULL, ..., toolkit = guiToolkit())

ggraphicsnotebook(width=dpi*6, height=dpi*6,dpi=75, container = NULL,..., toolkit = guiToolkit())

Arguments

Details

When multiple graphics devices are present, clicking in the window of one will make that the current device

The visible<- method makes the object the current device.

The svalue(obj, ..., value) method will save the visible window to the file in value. In gWidgetsRGtk2, if the window has another window clipping part of it, this clipping will be shown. This "hack" is needed, as dev.copy does not currently work for the "cairo" graphic device. (In future versions, there will be support for pdf files within cairo.)

The addhandlerclicked(obj, handler, action, ...) method where handler has first argument h has the additional values h$x and h$y where these are values are returned using "usr" coordinates (see help("par")). (This was in NDC coordinates)

Examples

Run this code
win = gwindow("Graphics example")
ggraphics(ps=6, container=win)
hist(rnorm(100))

Run the code above in your browser using DataLab