John Doucette
John Doucette

Reputation: 4540

Generating 3D plots in R with arbitrary data points and viewpoints

I want an R function that will let me do the following two things simultaneously:

  1. Plot arbitrary piecewise functions like scatterplot3d. That is, it should let me specify a arbitrary set of 3d coordinates at which points will be plotted.
  2. Let me set the viewpoint of the graph to arbitrary angles along both axises, like persp.

plot3d is not acceptable as it only allows manual adjustment of the plots once they are generated. I want to be able to script this.

Upvotes: 6

Views: 307

Answers (1)

Nick Sabbe
Nick Sabbe

Reputation: 11946

In a pckage I'm currently developing, addendum, there is a function plot4d that gives a neat example if how to do that with rgl. You don't have to use the package for it: just rip the source of the function.

(note: you may get 2 warnings when loading the package - this is because of a minor glitch in the otherwise beautiful glmnet package, and doesn't break anything.)

Upvotes: 1

Related Questions