MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: 3D contour through a point

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34025] Re: 3D contour through a point
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sat, 27 Apr 2002 00:56:28 -0400 (EDT)
  • References: <aab00u$mdl$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Bram,
I use ContourPlot for convenience:

    g=ContourPlot[Sin[x]+y,{x,0,Pi},{y,0,1},Contours->{Sin[.6]+.2},
        ContourShading->False ]

The above gives ContourGraphics object that does not contin the contour
lines explicitely - they areconstructed for each display.
Convert to a Graphics object that does contain the lines.

    g2=Graphics[g]

Delete lines that do not contain a point close enough to {.6,.2}

    g3=DeleteCases[g2,ln_Line/;Min[(#.#&[{.6,.2}-#])&/@ln[[1]]]<0.1,
Infinity];

    Show[g3];

We can extract the line

    Cases[g3,ln_Line,Infinity]

This technique could stand some refinement, and, if you wish to work
interactively you could extract all the contour lines:

    Cases[g2,ln_Line,Infinity]

and pick the one you want by inspection.

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565


"Bram Platel" <b.platel at stud.tue.nl> wrote in message
news:aab00u$mdl$1 at smc.vnet.net...
> I would like to make a contourplot of a 3D data set, but not from all the
> same gray levels in the image (as is default now) but I only want to plot
a
> contour surface that goes through one point in the 3D data set.
>
> For example, if I have a 3D dataset (e.g. a 3D image) and I plot a 3D
> contour of the gray value in pixel (x,y) then I could get a couple of
> contour surfaces which are not connected to each other and only one of
them
> goes through point (x,y).
> But what I want is only a contour surface that goes through this point
> (x,y). So that I can plot a contour that belongs to a point (and it's gray
> value).
>
> Any advice on this?
>
> Thanks,
> Bram
>
>
>




  • Prev by Date: Re: Getting File Directory Using Any Platform
  • Next by Date: RE: Test of a pure function
  • Previous by thread: 3D contour through a point
  • Next by thread: Getting File Directory Using Any Platform