How can I recreate this three-dimensional histogram?

I am talking about this picture:

Questions:

Is it R and not Matlab right? The page below says that it was made with R ....

How can i do this? I mean, how can I create such a 3d scatterplot with this advanced green surface and this mesh? I now how to make simple scatterplots as well as 3d scatterplots, but how can I create such an extended picture? Which package is this?

I want to include it in a document where this image should automatically rotate. I know how to include this in my tex distribution, but so I need a separate png. So, for example, 1000 single shots, which I animate. But how can I get those who have R? I will need to rotate it and then save each small rotation as an image file.

Thank you very much for your help, my biggest problems are creating this graphics (packages?) And how to make it rotate (r code?)

+1
source share
1 answer
  • To create this drawing, you can check the persp function. You can change the parameter to rotate the figure. Here is one demo:

     require(grDevices) # for trans3d x <- seq(-10, 10, length= 30) y <- x f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r } z <- outer(x, y, f) z[is.na(z)] <- 1 persp(x, y, z, theta = 90, phi = 30, expand = 0.5, col = "lightgreen") 

enter image description here

When changing theta = 30 :

 persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = "lightgreen") 

enter image description here

  1. For color, you can enter colors() to find out which color you can use. Currently, I have found that lightgreen may be the closest color.
+5
source

All Articles