| nr_mask_begin | R Documentation |
These functions are used to globally set a mask which determines where pixels are affected by drawing functions.
nr_mask_begin(nr, mask)
nr_mask_end(nr)
nr |
native raster image |
mask |
native raster image to use as mask. Must be the same size as
|
Drawing operations between
nr_mask_begin() and nr_mask_end() calls will only affect pixels
where the mask is not transparent.
Invisibly return the original native raster image which has been modified in-place
mask <- deer[[1]] |> nr_resize(600, 400)
plot(mask)
nr <- nr_new_from(mask)
nr_mask_begin(nr, mask = mask)
nr_circle(nr, 300, 200, 200, fill = 'blue', color = 'black')
nr_circle(nr, 350, 200, 100, fill = 'darkgreen', color = 'black')
nr_mask_end(nr)
plot(nr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.