从矩阵转换的光栅中的错误轴
Wrong axes in raster converted from matrix
我有以下代码:
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()
这将创建以下图像
如您所见,y 轴从 0 到 12,而不是 0 到 2040。X 轴上升到 60,而不是 10000。
我应该怎么做才能得到轴上的真实值?
如何强制在 Z 轴上显示 0?
此结果记录在 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()
我有以下代码:
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()
这将创建以下图像
如您所见,y 轴从 0 到 12,而不是 0 到 2040。X 轴上升到 60,而不是 10000。
我应该怎么做才能得到轴上的真实值?
如何强制在 Z 轴上显示 0?
此结果记录在 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()