[R] 4 dimensional graphics

Jim Lemon jim at bitwrit.com.au
Fri Jan 11 10:49:10 CET 2008


Petr PIKAL wrote:
> Thank you
> 
> Basically I have a rectangular space (like an aquarium) in which I made 
> some analysis. I can make
> 
> image(lat, long, value) for each height but what I dream about is to make 
> something like scatterplot3d(lat, long, height) with points set according 
> to a value.
> ...

Hi Petr,
How about this?

library(scatterplot3d)
library(plotrix)
scatterplot3d(pp4d$x,pp4d$y,pp4d$z,
color=color.scale(log(pp4d$value),c(0,1),c(0,1,0),c(1,0)),
pch=20,cex.symbols=3)
color.legend(8,-1,12,-0.5,
  round(c(min(pp4d$value),
  exp(sum(log(range(pp4d$value)))/2),
  max(pp4d$value))),
  rect.col=color.scale(1:5,c(0,1),c(0,1,0),c(1,0)))

Jim




More information about the R-help mailing list