Description Usage Arguments Details Value See Also Examples
Sets up graphical device and plots figure. For PDF device, also takes care of embedding fonts (see Details).
1 2 3 |
plotfun |
A function which does the actual plotting. |
... |
Additional arguments passed to |
device |
The type of graphical device. |
width, height |
The unscaled width and height of the graphics region in
inches. Actual size is |
scale |
The scaling factor. Is 1 for the default |
pointsize |
The base font size in points. |
filename |
The filename for PDF or SVG device. If "standard" extension is missing, it is added automagically. |
family |
The font family for PDF device (see Details). |
For PDF device, function does font embedding via call to
embedFonts
. The package provides additional font
families "CMRoman"
, "CMSans"
which work nicely with
cyrillics. These families are based on CM-Super font package by
Vladimir Volovich and CMSYASE symbol font by Paul Murrell.
Both metric (‘*.afm’) and outline (‘*.pfb’) files for the
"CMRoman"
, "CMSans"
fonts are provided with the
package. This allows to embed these fonts even if they are not
installed in the system.
Returns the result value of call to plotfun
invisibly.
Paul Murrell (2005?) Using Computer Modern Fonts in R Graphics. http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | x <- rnorm(10)
myplot <- function(x, legend, ...)
{
plot(x, ..., pch = 1)
legend('bottomright', bg = 'white',
legend = legend, pch = 1)
}
makefig(myplot, x = x, legend = 'Simulation')
makefig(myplot, x = x, legend = 'Simulation', pointsize = 8)
makefig(myplot, x = x, legend = 'Simulation',
device = 'pdf', filename = 'embedding.pdf', family = 'CMSans')
mapply(makefig, device = c('window', 'pdf', 'svg'),
MoreArgs = list(plotfun = myplot, x = x, legend = 'Simulation',
filename = 'test', family = 'CMSans'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.