0

I have following code:

library(raster)
library(rasterVis)
library(rgl)

mz <- matrix(5:7, 2040, 10000)
z <- raster(mz, xmn=0, ymn=0, xmx=ncol(mz)-1, ymx=nrow(mz)-1)
plot3D(z)
decorate3d()

This creates following image enter image description here

As you can see y axis goes from 0 to 12 instead of 0 to 2040. And X axis goes up to 60, instead of 10000.

What shall I do to get the real values on the axis?

And how do I enforce showing 0 on the Z axis?

mcsim
  • 1,647
  • 2
  • 16
  • 35

1 Answers1

1

This result is documented in the examples of the help page of plot3D:

Default: x-axis and y-axis are adjusted with z-values. Therefore, labels with decorate3d() are useless [...] Set adjust=FALSE to fix it

 plot3D(z, adjust=FALSE)
 decorate3d()
Oscar Perpiñán
  • 4,491
  • 17
  • 28