On Fri, Nov 27, 2009 at 6:14 PM, Umesh Srinivasan
<umesh.sriniva...@gmail.com> wrote:
> Hi,
>
> I have recently begun using the lattice package, and have been using
> the wireframe command to visualise matrices which are model outputs. I
> have been trying to plot two surfaces (from two matrices)
> simultaneously in one panel, to visualise intersections etc., but
> neither my attempts or trawling the net are helping me find how to do
> this.

The documentation for wireframe mentions the use of 'groups' to do
this, and the usual shortcut of using formulae of the form z1+z2 ~ x +
y also works. The following seems to work as expected, subject to
caveats mentioned in ?wireframe and ?panel.wireframe (there is no
hidden surface removal going on, so intersections will not be shown
correctly).

df <- as.data.frame.table(volcano)
names(df) <- c("x", "y", "height")
df$sheight <- scale(df$height)

wireframe(sheight + (-sheight) ~ x + y, df, aspect = c(1, .5))

-Deepayan

______________________________________________
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.

Reply via email to