Description Usage Arguments Details Value Author(s) Examples
Open a device to plot a figure
1 2 |
file |
filename for figure when run in non-interactive mode. If no filename is given for a non-interactive mode call, pdf files are named |
kind |
the desired kind of plot. Supports one of 'pdf', 'png', 'jpeg', or 'tiff' |
device |
the desired device, when run in interactive mode. This can be either |
type |
the type of device, for x11 devices, when run in interactive mode. This can be 'Xlib', 'cairo', etc. See |
imtype |
the type of device to use when writing to an image file (png and jpeg). Defaults to |
width, height |
desired width and height of the figure |
units |
units to use for the figure. |
res |
resolution to use for the png |
quality |
jpeg quality percentage to use; defaults to 95 |
... |
other device options, including options specific to particular devices |
This function is just a shortcut for making figures in a consistent way, to avoid copying and pasting code chunks. It will produce an on-screen figure when run in interactive mode (of default type x11). When run from the command line (e.g. using R --no-save < script.R
), it will produce a graphics file of the specified kind.
kind='jpeg'
uses a default quality of 95.
Note that for the file creation to function properly in non-interactive mode, the function call must be accompanied by:
if (!interactive()) dev.off()
or by closeFigure()
to turn the graphics device off.
none.
Clark Richards
1 2 3 | makeFigure('test', kind='pdf', height=3)
plot(rnorm(100), rnorm(100))
closeFigure()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.