MathGroup Archive 2007

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

Search the Archive

Re: Contour Lines

  • To: mathgroup at
  • Subject: [mg83610] Re: Contour Lines
  • From: Thomas E Burton <tburton at>
  • Date: Sat, 24 Nov 2007 04:17:59 -0500 (EST)

In the spirit of the notion that a fishing pole is better in the long  
run than a fish, let me share a recipe to solve this:

1. Look into plot1, note the expression GraphicsComplex.

2. GraphicsComplex is new to v6, so look it up in help.

3. Follow your nose, leading to something like the following:

pointList = Cases[plot1, GraphicsComplex[points_,
            data_] :> Cases[data, Line[pts : {__Integer}] :>  points 
[[pts]], Infinity]
    ][[1, 1]]


pointList =  Cases[
      Cases[plot1,  gc_GraphicsComplex:> Normal[gc]],
      Line[points_List] :> points, Infinity][[1]]

I use Cases so I don't have to remember where things are. You can  
certainly shorten these expressions.


> How do you extract the coordinates of points making up a Contour  
> Line as a List?
> This has been dealt with before in the archive (see e.g., ) but the  
> code there seems no longer to work. ...
> Convert the ContourGraphics to Graphics and then extract the first  
> part and you will see how Mathematica represents the contours.
> contour = First@Graphics@plot1 (output omitted) ...

  • Prev by Date: Re: Database like "left join" or SAS like Merge function
  • Next by Date: Re: Coloring cells
  • Previous by thread: Re: float -> RGB
  • Next by thread: Re: Contour Lines