Allows one to convert an arbitrary GTK+ widget (usually a
GtkPrintContext or a
Cairo context to a Cairo graphics device, so that R plot
commands draw to the given target.
The default font size in the R plot
Width in user coordinates, only used if
Height in user coordinates, only used if
The main purpose of this function is to allow the user to embed an R plot in a GTK user interface constructed with RGtk2. Please see the examples in the RGtk2 package.
Drawing to an offscreen
GdkPixmap is useful for
buffering and transforming R graphics.
For example, one could copy the pixmap to a
and add a watermark before saving as a gif, png, jpg, etc.
One may also pass a
Cairo context as the
parameter. This allows targeting arbitary Cairo surfaces. Note that
the context state is for the most part not cleared before plotting, so
transformations, etc, will remain in effect. Unlike Cairo, the R
graphics system requires bounds to be specified, which may be done
As a convenience,
GtkPrintContext is also accepted as the
widget parameter. This makes it easy to redirect R graphics to a
printer selected and configured through the GTK+ printing dialogs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.