ZHANG YUE ZHANG YUE - 1 year ago 99
R Question

R: Graph a 2-D function?

Suppose I have a function x^2+y^2=1, how can I graph this function in R?

I have tried:
enter image description here

but it doesn't work and says:
enter image description here

Answer Source

Try this:

x <- seq(-1,1,.01)
plot(0,0, xlim=c(-1,1), ylim=c(-1,1))
curve(sqrt(1-x^2), add=TRUE)
curve(-sqrt(1-x^2), add=TRUE)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download