[mg90415] Re: Extracting points from a contour plot

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown [mg90415] Re: Extracting points from a contour plot

by Jens-Peer Kuska :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

cntr = ContourPlot[Sin[Pi^2*x*y], {x, 0, 1}, {y, 0, 1},
    Contours -> {0}, ContourShading -> False];
pnts = cntr[[1, 1]];
pidx = Union[Flatten[Cases[cntr, _Line, Infinity] /. Line -> List]];
ll = pnts[[#]] & /@ pidx;

and
Graphics[Point[ll]]

will show you, that you have found the right points.
And the accuracy of the generated points will to low
in the most cases.

Regards
   Jens

ajfriend@... wrote:

> I'm not a Mathematica expert, so hopefully this isn't too stupid of a
> question:
>
> I'm using ContourPlot to plot the curve of zeros of a function of two
> variables within a range of vales (0 < x < 1, 0 < y < 1). Now, what I
> really want is the list of points that it generates. I've tried
> playing with Solve and NSolve, but these are either not working or are
> taking too long. What is the easiest way of getting at the list of
> points that ContourPlot has generated? Do I have to do something like
> InputForm[%] and then cut and paste the list that I want, or is there
> some easier way of doing it?
>
> Or, maybe there is a way of getting the points that I want without
> using ContourPlot that I haven't come across yet, or maybe I'm just
> not using Solve correctly.
>
> Any help would be great.
>
> Thanks,
> AJ
>

LightInTheBox - Buy quality products at wholesale price