I have my R data in x
, y
, and z
format, x
and y
being vectors of length 10 and 19 respectively and z
being a matrix of 10x19 integers. I have the following code that prints my 3D surface:
height <- (z - range(z)[1]) / diff(range(z))
r.prop <- height
g.prop <- 0
b.prop <- 1 - height
color <- rgb(r.prop, g.prop, b.prop, maxColorValue=1)
persp3d(x, y, z, theta=50, phi=25, expand=0.75, col=color, ticktype="detailed",
xlab="filesize [kb]", ylab="record size [kb]", zlab="speed [b/s]",
axes=TRUE)
My problem is that the y
axis contains powers of 2 (4, 8, 16, 32, 64, ..., 2048,..), which squeezes most of my data points into the low-range part of the plot. What I want is an even distribution of the data points, i.e. between point 4 and 8 should be the same space as between 1024 and 2048 just like it is in the Excel spreadsheet surface plot.
Can you tell me which command or parameter would make that happen with persp3d?
Thanks a bunch! Loddi
Addition: After changing the the axes to log2, or just doing a c(1:length(x)) and c(1:length(y)) instead of the actual axis values, it looks better but now has these weird jigsaw shape that is not at all represented in my data. Do you guys have a clue what is going on here? see picture here https://i.stack.imgur.com/WBI3r.png