Re: Re: Problems with ImplicitPlot
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1272] Re: [mg1250] Re: Problems with ImplicitPlot
- From: Allan Hayes <hay at haystack.demon.co.uk>
- Date: Wed, 31 May 1995 03:05:39 -0400
In <3q14jp$725 at news0.cybernetics.net>,
Mats Jirstrand <matsj at isy.liu.se> writes
->I have a problem with the function ImplicitPlot in the
->Graphics package!
->
->Why does Mathematica generate a plot of the unit circle
->for the first of the below commands but not for the second?
->
->ImplicitPlot[x^2+y^2-1==0, {x, -2, 2}]
->
->ImplicitPlot[(x^2+y^2-1)^2==0, {x, -2, 2}]
->
->
->
->I have also tried the ContourPlot function with the same result:
->
->ContourPlot[x^2+y^2-1, {x, -2, 2},{y, -2, 2},
-> Contours -> {0},
-> ContourShading -> False]
->
->Plots the unitcircle!
->
->
->ContourPlot[(x^2+y^2-1)^2, {x, -2, 2},{y, -2, 2},
-> Contours -> {0},
-> ContourShading -> False]
->
->An empty plot!
->
->
->~~Mats
->
I don't see why ImplicitPlot is failing since it uses Solve and
yx = Solve[(x^2+y^2-1)^2==0,y]
Plot[Evaluate[y/.yx], {x,-2,2}]
works OK (with some warnings).
The main reason for
ContourPlot[(x^2+y^2-1)^2, {x, -2, 2},{y, -2, 2},
Contours -> {0},
ContourShading -> False]
failing is I think that
ContourPlot[f[x,y],.., Contours -> {0}..]
looks for distinct points {x1,y1},{x2,y2} where f[x1,y1] <= 0 <=
f[x2,y2].
But there is also seems to be a numerical aspect since
ContourPlot[(x^2+y^2-1)^2, {x, -2, 2},{y, -2, 2},
Contours -> {0},
ContourShading -> False,
PlotPoints -> 3]
gives the line x=0,
whilst
ContourPlot[(x^2+y^2-1)^2, {x, -2, 2},{y, -2, 2},
Contours -> {0},
ContourShading -> False,
PlotPoints -> 7]
does not.
Allan Hayes
hay at haystack.demon.co.uk