x <- seq(-pi, pi, l = 200)
plot(x, x, type = "n", ylab = "Density", ylim = c(0, 0.6))
for (i in 0:20) {
lines(x, dJp(x = x, mu = 0, kappa = 1, psi = -2 + 4 * i / 20),
col = rainbow(21)[i + 1])
}
Run the code above in your browser using DataLab