| nr_circle | R Documentation |
Draw circles on a native raster image
nr_circle(nr, x, y, r, fill = "black", color = NA, use_alpha = TRUE)
nr |
native raster image |
x, y |
coordinates of centre of circle. [vector] |
r |
radius [vector] |
fill |
interior fill color [vector] |
color |
outline color. Default: NA. [vector] |
use_alpha |
Use alpha channel when drawing? Logical. Default: TRUE |
Invisibly return the supplied native raster image which was been modified in-place
Other drawing functions:
nr_polygon(),
nr_polyline(),
nr_rect(),
nr_tri_mesh()
set.seed(1)
w <- 200
h <- 150
nr <- nr_new(w, h, 'black')
N <- 10
coords <- expand.grid(x = seq(2, w, length.out = N),
y = seq(2, h, length.out = N))
cols <- sample(grDevices::terrain.colors(nrow(coords)))
nr_circle(
nr,
x = coords$x,
y = coords$y,
r = w/N/1.3,
fill = cols
)
plot(nr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.