Description Usage Arguments Value Author(s) References See Also Examples
This is the general function and associated R methods to create a graphics device whose primitive methods are implemented via R functions.
1 2 |
name |
either the name of the device or a
|
dim |
a numeric/integer vector giving the width and height of the device. |
col |
the default/starting drawing color |
fill |
the default/starting color used to fill rectangles, circles, etc. |
ps |
the initial point size for the default font |
... |
zero or more name = value pairs which are used as
functions implementing the graphics device methods.
The names must (partially) match the slot names of the |
funcs |
this is an alternative way to specify functions that implement the graphics device methods. We use this when the functions are already in a list and it is akward to specify them via the ... mechanism. This can be |
ipr |
a numeric vector of length 2 giving the number if inches per raster/pixel for each of the horizontal and vertical dimensions. |
An object of class DevDescPtr-class
.
Duncan Temple Lang
“The R Internals Manual”, R Development Core Team.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | devFuns = dummyDevice()
dev = graphicsDevice("MyDummyDevice", funcs = devFuns)
.Devices
dev$right
dev$right = 1000
dev$bottom = 800
# All important to get the plot region with adequate margins
# and basically get anything working.
dev$ipr = rep(1/72.27, 2)
dev$right
dev$ipr
as(dev, "DevDesc")
plot(1:10)
dev.off()
# warnings are coming from the lack of a return from functions that
#
devFuns = dummyDevice(initDevice = function(dev) {
dev$ipr = rep(1/72.27, 2)
dev$cra = rep(c(6, 13)) * 10/12
},
GEInitDevice = function(dev) {
gedev <- as(dev, "GEDevDescPtr")
gedev$recordGraphics = TRUE
gedev$ask = TRUE
})
dev = graphicsDevice("MyDummyDevice", funcs = devFuns)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.