[R] Wireframe graph: black and white shading instead of color

Deepayan Sarkar deepayan.sarkar at gmail.com
Thu Nov 29 21:38:43 CET 2007


On 11/29/07, David Afshartous <dafshartous at med.miami.edu> wrote:
>
>
> All,
>
> The code below produces a color 3D graph.  I'd like to make it black and
> white shading.  I tried setting col.regions to FALSE but this just made it
> completely white.  I want the graph to look exactly as is, except black (or
> grey) and white shading.  Is this possible?

Perhaps you want something like

wireframe(Z ~ X * Y, drape = TRUE, par.settings = standard.theme(color = FALSE))

Generally, for black and white output, the recommended approach is to
start a device using

trellis.device(..., color = FALSE)

The call above attaches the resulting settings to the particular
object rather than the device.

-Deepayan


>
> Cheers,
> David
>
>
> p.list = c(.01, .1, .25, .5, .75, .9)
> cov.list = c(.2, .1, .05)  ### leave out .01
>
>
>
> X = rep(p.list, 3)
> Y = rep(cov.list, 1, each=6)
> Z = c(2475.000000,   225.000000,    75.000000,    25.000000,     8.333333,
> 2.777778,  9900.000000, 900.000000,   300.000000,   100.000000,
> 33.333333,    11.111111, 39600.000000,  3600.000000,
> 1200.000000,   400.000000,   133.333333,    44.44444)
>
>
> lattice.options(default.theme = "col.whitebg")
>
>
>
> wireframe(Z ~ X * Y, scales = list(arrows = FALSE),
>
>                bg = "white", drape = TRUE, shade = FALSE, colorkey = FALSE,
> xlab = "p", ylab = "C.O.V.", zlab ="n")
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list