Skip to contents

Plot a 2D Delaunay tessellation.

Usage

plotDelaunay2D(
  tessellation,
  border = "black",
  color = "distinct",
  hue = "random",
  luminosity = "light",
  lty = par("lty"),
  lwd = par("lwd"),
  ...
)

Arguments

tessellation

the output of delaunay

border

the color of the borders of the triangles; NULL for no borders

color

controls the filling colors of the triangles, either FALSE for no color, "random" to use randomColor, or "distinct" to use distinctColorPalette

hue, luminosity

if color = "random", these arguments are passed to randomColor

lty, lwd

graphical parameters

...

arguments passed to plot

Value

No value, just renders a 2D plot.

Examples

# random points in a square
set.seed(314)
library(tessellation)
library(uniformly)
square <- rbind(
  c(-1, 1), c(1, 1), c(1, -1), c(-1, -1)
)
ptsin <- runif_in_cube(10L, d = 2L)
pts <- rbind(square, ptsin)
d <- delaunay(pts)
opar <- par(mar = c(0, 0, 0, 0))
plotDelaunay2D(
  d, xlab = NA, ylab = NA, asp = 1, color = "random", luminosity = "dark"
)

par(opar)