[R] how do I draw this surface -- hand drawn in the attachemtn
Kingsford Jones
kingsfordjones at gmail.com
Mon Sep 7 22:35:24 CEST 2009
for example...
x <- y <- seq(.1, 2, .1)
ftn <- function(x, y) x - .25*x^2
z <- outer(x, y, ftn)
persp(x, y, z, theta = 330, phi = 30)
hth,
Kingsford
On Sun, Sep 6, 2009 at 8:28 AM, Steve
Lianoglou<mailinglist.honeypot at gmail.com> wrote:
> Hi,
>
> On Sat, Sep 5, 2009 at 5:16 AM, gallon li<gallon.li at gmail.com> wrote:
>> Basially I have the observation for x, y, and z
>>
>> for each fixed z, the value of y moves from 0 to y0 as x moves from 0 to x0.
>> I then move the curve for z from 0 to z0 and form a continuous surface. want
>> to know if there is a way that R can replace my handdrawing.
>
> Do the examples in ?persp help?
>
> How about this example from the r graph gallery:
>
> http://addictedtor.free.fr/graphiques/graphcode.php?graph=42
>
> I think lattice graphics also has functions to help plotting in 3d,
> but I've never used it. I've only seen it in actio in the lattics vs.
> ggplot series of posts on the learnr.wordpress.com blog (very
> helpful).
>
> -steve
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
> | Memorial Sloan-Kettering Cancer Center
> | Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact
>
> ______________________________________________
> 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