If you simply plot the data in 3D the result is not so obvious as can be seen on this picture:
However, using rgl package I managed to get the job done really fast. It allows for interactive rotation of the plot and one can easily find the appropriate viewpoint. The only obstacle is that in order to see all 15 lines on one view one needs to set filed-of-view to 0 to get orthogonal projection. Here is the code that generates the required plot:
library(rgl)
with(randu, plot3d(x, y, z, axes = FALSE,
xlab = "", ylab = "", zlab = ""))
rgl.viewpoint(theta = -3.8, phi = 3.8, fov = 0, zoom = 0.7)
rgl.snapshot("randu.png")
It generates the following result, nicely showing 15 parallel lines:
How have you chosen theta and phi parameters?
ReplyDeletergl package allows for manual rotation of 3D picture. So I knew what rotation I performed from the starting plot to the desired plot. This allowed me to get a rough idea of direction and magnitde for theta and phi. Exact values were obtained by experimentation.
ReplyDelete