I need grayscale formatting for a wireframe. The only col.regions that I can find are color palettes are all colored: rainbow(n, s = 1, v = 1, start = 0, end = max(1,n - 1)/n, gamma = 1, alpha = 1) heat.colors(n, alpha = 1) terrain.colors(n, alpha = 1) topo.colors(n, alpha = 1) cm.colors(n, alpha = 1) The code follows: X11() library(lattice) par(family="serif", cex=1.2) wireframe(z ~ y*x, mat.df, drape = TRUE,col.regions=rainbow(100), zlab = list("Water mass error (%)",rot=90), zlim=c(-50,180), xlab = list("Resistance error (%)",rot=-9), ylab = list("Length error (%)",rot=38), scales = list(arrows = FALSE), screen = list(z = -35, x = -77, y = 10)) -- M. Keith Cox, Ph.D. Alaska NOAA Fisheries, National Marine Fisheries Service Auke Bay Laboratories 17109 Pt. Lena Loop Rd. Juneau, AK 99801 Keith.Cox at noaa.gov marlinkcox at gmail.com U.S. (907) 789-6603
A standalone example is always appreciated (cf. the posting guide) but try and see if help("gray.colors", package="grDevices") is the sort of thing you are looking for. Hope this helps Allan On 06/07/10 23:30, Marlin Keith Cox wrote:> I need grayscale formatting for a wireframe. > The only col.regions that I can find are color palettes are all colored: > > rainbow(n, s = 1, v = 1, start = 0, end = max(1,n - 1)/n, > gamma = 1, alpha = 1) > heat.colors(n, alpha = 1) > terrain.colors(n, alpha = 1) > topo.colors(n, alpha = 1) > cm.colors(n, alpha = 1) > > The code follows: > > X11() > library(lattice) > par(family="serif", cex=1.2) > wireframe(z ~ y*x, mat.df, > drape = TRUE,col.regions=rainbow(100), > zlab = list("Water mass error (%)",rot=90), zlim=c(-50,180), > xlab = list("Resistance error (%)",rot=-9), > ylab = list("Length error (%)",rot=38), > scales = list(arrows = FALSE), > screen = list(z = -35, x = -77, y = 10)) > > >
With grDevices package, I do the following to generate a greyscale: newcols <- colorRampPalette(c("white", "black")) #generates palette from white to black #OR newcols <- colorRampPalette(c("grey90", "grey10")) #generates palette frome light to dark grey for better visibility Then in the wireframe() command type the argument: col.regions=newcols(100) -- View this message in context: http://r.789695.n4.nabble.com/grayscale-wireframe-tp2280281p2281127.html Sent from the R help mailing list archive at Nabble.com.