nr_point: Draw points on a native raster image

View source: R/nr-draw.R

nr_pointR Documentation

Draw points on a native raster image

Description

Draw points on a native raster image

Usage

nr_point(nr, x, y, color = "black", use_alpha = TRUE)

Arguments

nr

native raster image

x, y

Vectors of point coordinates

color

Vector of colors

use_alpha

Use alpha channel when drawing? Logical. Default: TRUE

Value

Invisibly return the supplied native raster image which was been modified in-place

Examples

w <- 200
h <- 150
nr <- nr_new(w, h, 'grey80')

coords <- expand.grid(x = seq(w) - 1, y = seq(h) - 1)
cols   <- sample(rainbow(nrow(coords)))
nr_point(nr, x = coords$x, y = coords$y, color = cols) 
plot(nr)


nara documentation built on May 28, 2026, 5:07 p.m.