plotDelaunay2D {tessellation}R Documentation

Plot 2D Delaunay tessellation

Description

Plot a 2D Delaunay tessellation.

Usage

plotDelaunay2D(
  tessellation,
  border = "black",
  color = "distinct",
  distinctArgs = list(seedcolors = c("#ff0000", "#00ff00", "#0000ff")),
  randomArgs = list(hue = "random", luminosity = "bright"),
  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 createPalette

distinctArgs

if color = "distinct", a list of arguments passed to createPalette

randomArgs

if color = "random", a list of arguments 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",
  randomArgs = list(hue = "random", luminosity = "dark")
)
par(opar)

[Package tessellation version 2.3.0 Index]