Learn R Programming

pcds (version 0.1.8)

plotDelaunay.tri: The scatterplot of points from one class and plot of the Delaunay triangulation of the other class

Description

Plots the scatter plot of Xp points together with the Delaunay triangles based on the Yp points. Both sets of points are of 2D.

See (okabe:2000,ceyhan:comp-geo-2010,sinclair:2016;textualpcds) for more on Delaunay triangulation and the corresponding algorithm.

Usage

plotDelaunay.tri(
  Xp,
  Yp,
  main = NULL,
  xlab = NULL,
  ylab = NULL,
  xlim = NULL,
  ylim = NULL,
  ...
)

Value

A scatterplot of Xp points and the Delaunay triangulation of Yp points.

Arguments

Xp

A set of 2D points whose scatterplot is to be plotted.

Yp

A set of 2D points which constitute the vertices of the Delaunay triangles.

main

An overall title for the plot (default=NULL).

xlab, ylab

Titles for the \(x\) and \(y\) axes, respectively (default=NULL for both).

xlim, ylim

Two numeric vectors of length 2, giving the \(x\)- and \(y\)-coordinate ranges (default=NULL for both)

...

Additional plot parameters.

Author

Elvan Ceyhan

References

See Also

plot.triSht in interp package

Examples

Run this code
# \donttest{
nx<-20; ny<-5;  #try also nx<-40; ny<-10 or nx<-1000; ny<-10;

set.seed(1)
Xp<-cbind(runif(nx,0,1),runif(nx,0,1))
Yp<-cbind(runif(ny,0,.25),runif(ny,0,.25))+cbind(c(0,0,0.5,1,1),c(0,1,.5,0,1))
#try also Yp<-cbind(runif(ny,0,1),runif(ny,0,1))

plotDelaunay.tri(Xp,Yp,xlab="",ylab="",main="X points and Delaunay Triangulation of Y points")
# }

Run the code above in your browser using DataLab