x = sin(phi) + 2 * sin(2 * phi)
y = cos(phi) - 2 * cos(2 * phi)
z = -sin(3 * phi)
dcol < -c(rep(1, 400), rep(2, 400), rep(3, 400))
ggknot < -data.frame(x, y, z, dcol)
Color sine parametric knot with R and ggplot2