Have you considered the following [from Venables and Ripley (2002)
Modern Applied Statistics with S, 4th ed. (Springer, p. 76, sec. 4.2):
library(MASS)
topo.loess <- loess(z~x*y, topo, degree=2, span=0.25)
topo.mar <- list(x=seq(0, 6.5, .2), y=seq(0, 6.5, .2))
topo.lo <- predict(topo.loess, expand.grid(topo.mar))
par(pty="s")
contour(topo.mar$x, topo.mar$y, topo.lo, xlab="", ylab="",
levels=seq(700, 1000, 25), cex=0.7)
hope this helps. spencer graves
Shuxia Yu wrote:
>Dear all,
>
>I don't know how to operate on the following data (a very small part of a data
>set) to generate an 3D contour plot. In the following data, X, Y and Z is the
>point coordinate in 3D space, and W is the response. I hope to get a contour
>plot of W in the 3D space. I don't know if it's possible in S+.
>
>Any suggestions will be really appreciated.
>
>Best regards,
>Jinsong
>
>
>
>>a
>>
>>
> X Y Z W
> 1 -8 -10 -10 1.5
> 2 -7 -10 -9 1.5
> 3 -6 -10 -8 -1.5
> 4 -5 -10 -7 1.5
> 5 -4 -10 -6 -1.5
> 6 -3 -10 -5 -1.5
> 7 -2 -10 -4 1.5
> 8 -1 -10 -3 1.5
> 9 0 -10 -2 -1.5
>10 1 -10 -1 1.5
>11 2 -10 0 -1.5
>12 3 -10 1 1.5
>13 4 -10 2 1.5
>14 5 -10 3 1.5
>15 6 -10 4 1.5
>16 7 -10 5 -1.5
>17 8 -10 6 -1.5
>18 -8 -9 7 1.5
>19 -7 -9 8 -1.5
>20 -6 -9 9 1.5
>
>
>-------------------------------------------------------------------------------------
>周杰伦在"第一现场"与你面对面
>http://smspop.163.com/special/jay200408/index2.html--------------------------------------------------------------------
>This message was distributed by s-news@lists.biostat.wustl.edu. To
>unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
>the BODY of the message: unsubscribe s-news
>
>
--
Spencer Graves, PhD, Senior Development Engineer
O: (408)938-4420; mobile: (408)655-4567
|