MathGroup Archive 1998

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

Search the Archive

Re: Extract a contour from a 3-D plot.



Chris Farr wrote:
> 
> I would like to extract a contour from a 3-D plot.
> 
> I am particularly interested in the contour associated with a value of 
> zero.  That is, the curve generated when I set the option in
> ContourPlot  to Contours->{0}.
> 
> How can I extract this contour ( I guess the contour would be a 
> collection of XY coordinates) ?  What if there are two contours with a
>  value of zero?  How can I extract both of them?  Thanks in advance.
> 
> Chris Farr

This is a programming problem and will not be solved with one-line built
in commands, so you will need to hunt around for the correct commands
and program what you want.  Here is the general method:


When you say you want a contour from a 3-D plot, do you mean you want to
extract this information from the Graphics object or from the data or
function used to generate the plot?

If you want to extract it from the Graphics object itself, look at the
first or second element of the graphics object and you will usually
find a list of data points.  Extract them and do an Interpolation on
them, then plot a contour as you see fit.

If you already have the data, use Interpolation to make a continuous
function of two variables, then plot it out as you choose for a fixed
value of one parameter.

You will probably need to experiment a bit with pure function constructs
to get the InterpolationFunction object to take parameters in a
"normal" fashion.

You also asked about "what if there are two contours"?  Do you mean in
orthogonal directions or that your 3-D graphics object is a
multi-valued function of the parameters?  If it is multi-valued, you
won't be able to use the Interpolation command directly.  You will
first need to separate the data into, say, upper and lower shells via
some criteria, then deal with each shell separately.  If you mean that
the two contours are in orthogonal directions, then the previous method
with Interpolation functions will give you either depending on which
parameter you hold fixed.  
-- 
Remove the _nospam_ in the return address to respond.



  • Prev by Date: Re: ListPlot3D Color
  • Next by Date: Re: VirusScan
  • Prev by thread: Extract a contour from a 3-D plot.
  • Next by thread: Re: Extract a contour from a 3-D plot.