3

I loved a 3D plot I saw in this article and I am trying to reproduce it with my own data.

So far, I'm quite happy with the plot I obtain with the following code:

d <- expand.grid(x = seq(0, 20, by = 1), 
                 y = seq(3.5, 5.5, by = .2))
d <- dplyr::mutate(d, z = (5.4 + (-25.5*x) + 
                          (12.5*(x^2)) + 
                          (1.5*y) + 
                          (0.03*y*x) + 
                          (-1.23*y*(x^2))))
lattice::wireframe(z ~ x * y, 
                   data = d,
                   screen = list(z = 130, x = -70),
                   scales = list(arrows = F))

Output: enter image description here

However (I apologise for my ignorance in advance), although I am sure that it has to be possible, I can't figure out how to include the grid on each of the three back planes, in the same fashon than it appears in the paper I linked at the beginning. Is it possible? How would you do that?

rcirer
  • 31
  • 5
  • 1
    I'm trying to learn R and found this question interesting. I would expect also that it is a standard function, but I have not seen any example on SO or elsewhere with a grid in the back. I tried keywords that work in 2D with no effect. You could probably write a function that places constructed 3D meshs in the back [similar to this question.](https://stackoverflow.com/a/17764124/8881141) I have seen other libraries that seem to have implemented it. I guess I stick with [Python/matplotlib](https://matplotlib.org/3.0.0/gallery/animation/random_walk.html#sphx-glr-gallery-animation-random-walk-py) – Mr. T Oct 28 '18 at 17:53
  • P.S.: If you find an answer somewhere, you are encouraged to [post it here on SO.](https://stackoverflow.com/help/self-answer) – Mr. T Oct 28 '18 at 17:55

0 Answers0