Hello group
Im trying to plot 3d with scatterplot packages, i got error say " length(color) must be equal length(x) or 1 " may data has dimensions (lon,lat,lev,time) ,the time in month i want to calculate the monthly mean for the time how can i make that , is there any function doing that Thanks a lot ##load rgl package library(rgl) library(fields) library(ncdf) library(scatterplot3d) ## open binary file to read nc <- open.ncdf("/srv/ccrc/data05/z3236814/mm5/co2/2000/q.200001.mon.nc") v1 <- nc$var [[1]] v2 <- nc$var [[2]] v3 <- nc$var [[3]] data1 <- get.var.ncdf(nc,v1) data2 <- get.var.ncdf(nc,v2) data3 <- get.var.ncdf(nc,v3) coldat = data1[1:111,1:101,23,1:60] ## creat colour hcol = cumsum(coldat) coldat = hcol hcol = hcol/max(hcol,na.rm=TRUE) col <- hsv(h=hcol,s=1,v=1) X <-scatterplot3d(data3[1:111,1:101],data2[1:111,1:101],data1[1:111,1:101,23,1:60],color=col) ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.