grid.rasterize: Rasterize 'grid' output

Description Usage Arguments Details Value Author(s) Examples

View source: R/rasterize.R

Description

This function can be used to selectively rasterize components of a 'grid' image.

Usage

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)

Arguments

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 grid.grep.

res

The raster resolution (dpi).

Details

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.

Value

NULL

Author(s)

Paul Murrell

Examples

1
2
3
4

rasterize documentation built on May 2, 2019, 3:33 p.m.