[R] Changing direction of an axis in cloud or wireframe plot

Peter Ehlers ehlers at ucalgary.ca
Tue Feb 2 08:12:16 CET 2010


Ben Dean wrote:
> Is there a way to change the direction in which an axis is plotted in
> cloud/wireframe?
> 
> For example, for the following code:
> 
> g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2)
> 
> g$z <- log((g$x^g$g + g$y^2) * g$gr)
> 
> wireframe(z ~ x * y, data = g, groups = gr,
>           scales = list(arrows = FALSE),
>           drape = TRUE, colorkey = TRUE,
>           screen = list(z = 80, x = -60))
> 
> Is there a way to make the y-axis increase from left to right (i.e.,
> increase from 6 to 14)? I'd like to maintain the same screen position,
> with the x-axis increasing as it moves away.

wireframe(z ~ y * x, data = g, groups = gr,
           scales = list(arrows = FALSE),
           drape = TRUE, colorkey = TRUE,
           screen = list(z = -10, x = -60))

  -Peter Ehlers

> 
> Thanks for any help!
> 
> Ben.
> 
> ______________________________________________
> 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.
> 
> 

-- 
Peter Ehlers
University of Calgary



More information about the R-help mailing list