# define points
x <- c(0.42, 1.90, 2.06, 1.28, 1.01, 1.05, 1.34, 2.14,
4.25, 6.69, 7.96, 8.88, 9.35, 9.41, 8.84)
y <- c(1.06, 0.86, 1.91, 2.90, 4.25, 5.52, 6.81, 8.03,
9.03, 9.25, 9.30, 8.88, 8.36, 7.00, 6.50)
# visualize the line with a sawteeth
plot(x, y, xlim=c(0,10), ylim=c(0, 10))
sawteeth(cbind(x,y), left=TRUE, col="#99000077")
sawteeth(cbind(x,y), left=TRUE, col="black", shape=0.5)
# use combination of cex and shape to control the size triangles
plot(x, y, xlim=c(0,10), ylim=c(0, 10))
sawteeth(cbind(x,y), left=TRUE, col="#99000077", cex=0.5, shape=3)
Run the code above in your browser using DataLab