Description Usage Arguments Details Value Author(s) Examples
This function can be used to selectively rasterize components of a 'grid' image.
1 2 3 4 5 6 7 | grid.rasterize(x, ..., res = 72)
## S3 method for class 'character'
grid.rasterize(x, ..., res = 72)
## S3 method for class 'gPath'
grid.rasterize(x, merge=FALSE, redraw=TRUE, ..., res = 72)
## S3 method for class 'function'
grid.rasterize(x, ..., res = 72)
|
x |
What to rasterize. Can be a function (and the 'grid' output for that function will be rasterized). Can be the name of a grob (or a gPath) and that grob will be rasterized. |
merge |
Whether to replace multiple grobs with a single raster (or replace each grob with its own raster). |
redraw |
Whether to redraw the scene after replacing the grob with a raster. |
... |
For the character and gPath methods,
arguments passed on to |
res |
The raster resolution (dpi). |
The rasterization occurs in the context of the current viewport. A temporary PNG device is opened, the current viewport tree (below the current viewport) is enforced on the temporary device and the specified function or grob(s) are drawn on the temporary device. The resulting raster is drawn within the current viewport. For the character and gPath methods, the raster replaces the grob that was rasterized.
NULL
Paul Murrell
1 2 3 4 | grid.newpage()
grid.rect(width=.8, height=.8)
grid.text("test", name="t")
grid.rasterize("t")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.