# NOT RUN {
library(ggplot2)
p=c(1, 1, 0, -1, -1, -1, 0, 1)
q=c(0, 1, 1, 1, 0, -1, -1, -1)
pq=data.frame(cbind(p, q))
dat=sunshinexy(outer=pq, n=20, delete_n=5, distance=TRUE)
ggplot()+coord_fixed()+theme_void()+
geom_point(data=pq, aes(p, q), size=4)+
geom_line(show.legend=FALSE, data=dat, aes(x, y, group=g, color=distance), size=2)+
scale_color_continuous(low="blue", high="red")
# }
Run the code above in your browser using DataLab