Skip to content
Back to formatted view

Raw Message

Message-ID: <48D9281A.40507@stats.uwo.ca>
Date: 2008-09-23T17:32:10Z
From: Duncan Murdoch
Subject: How to draw the graph of f(x,y) = x * y ?
In-Reply-To: <6ade6f6c0809230954r54de7868j8498a6a2308633cf@mail.gmail.com>

On 9/23/2008 12:54 PM, Paul Smith wrote:
> Dear All,
> 
> The function curve() draws the graph of functions from R to R. Is
> there some homologous function to curve() to draw functions from R^2
> to R?

No, you would have to write it yourself.  The basic idea is to use 
outer() to construct a matrix of function evaluations, then plot the 
matrix using persp, contour, image, rgl::persp3d, etc.  There are 
examples on the ?contour man page.

Duncan Murdoch