[R] Is there any function in R like ezplot in matlab?

Duncan Murdoch murdoch at stats.uwo.ca
Sat Jan 9 12:04:27 CET 2010


On 09/01/2010 5:22 AM, 军 吕 wrote:
> Hi,
> 
> Is there any function in R like ezplot in matlab?
> 
> How to draw the relationship  between x y like this
> 
> x^y+y^(sinx)=log(x+y)
> 


It's not pre-packaged, but drawing a contour plot of the function

f <- function(x,y) x^y+y^sin(x) - log(x+y)

should do it:

xvals <- yvals <- seq(0, 30, len=1000)
zvals <- outer(xvals, yvals, f)
contour(xvals, yvals, zvals, levels=0)


Duncan Murdoch



More information about the R-help mailing list