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.
plotDeltri(
Xp,
Yp,
main = "",
xlab = "",
ylab = "",
xlim = NULL,
ylim = NULL,
...
)
A set of 2D points whose scatterplot is to be plotted.
A set of 2D points which constitute the vertices of the Delaunay triangles.
An overall title for the plot (default=""
).
Titles for the ""
for both).
Two numeric
vectors of length 2, giving the NULL
for both)
Additional plot
parameters.
A scatterplot of Xp
points and the Delaunay triangulation of Yp
points.
plot.triSht
in interp
package
# NOT RUN {
nx<-20; ny<-4; #try also nx<-40; ny<-10 or nx<-1000; ny<-10;
set.seed(1)
Xp<-cbind(runif(nx),runif(nx))
Yp<-cbind(runif(ny),runif(ny))
oldpar <- par(no.readonly = TRUE)
plotDeltri(Xp,Yp,xlab="",ylab="",main="X points and Delaunay Triangulation of Y points")
P<-c(.6,.4)
plotDeltri(P,Yp,xlab="",ylab="",main="X points and Delaunay Triangulation of Y points")
plotDeltri(Xp,Yp,xlab="",ylab="")
plotDeltri(Xp,Yp[1:3,],xlab="",ylab="")
plotDeltri(Xp,rbind(Yp,Yp),xlab="",ylab="")
dat.fr<-data.frame(a=Xp)
plotDeltri(dat.fr,Yp,xlab="",ylab="")
dat.fr<-data.frame(a=Yp)
plotDeltri(Xp,dat.fr,xlab="",ylab="")
par(oldpar)
# }
Run the code above in your browser using DataLab