
Last chance! 50% off unlimited learning
Sale ends in
Capture the current contents of a graphics device as a raster (bitmap) image.
grid.cap()
A matrix of R colour names, or NULL
if not available.
This function is only implemented for on-screen graphics devices.
dev.capabilities
to see if it is supported.
# NOT RUN {
dev.new(width=0.5, height=0.5)
grid.rect()
grid.text("hi")
cap <- grid.cap()
dev.off()
if(!is.null(cap))
grid.raster(cap, width=0.5, height=0.5, interpolate=FALSE)
# }
Run the code above in your browser using DataLab