[R] 3D-plots of 2D-grids

jas jacqueline.schweizer at wuestundpartner.com
Thu Feb 14 17:05:45 CET 2013

calc_ext3.asc <http://r.789695.n4.nabble.com/file/n4658564/calc_ext3.asc>  

I supplied a small extent of the grid, that I am trying to visualize. It s a
ascii-grid with 800 cells. My goal is to display the Grid-Values as the
z-variable. The point that I dont understand, is what is my input as x and
y-Variable in the persp-function? Do I have to make 8 vectors with 100
entries and plot them individually? 

Your help is greatly appreciated,


pop.mat <- as.matrix(pop.grid) # order is not right here already

z <- pop.mat
x <- 1:nrow(z)
y <- 1:nrow(z)
persp(x,y,z, phi=30,  border=NA)
# Error n persp.default(x, y, z, phi = 30, border = NA) : 
  invalid 'z' Argument

View this message in context: http://r.789695.n4.nabble.com/3D-plots-of-2D-grids-tp4658517p4658564.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list