Re: Contourline values
- To: mathgroup at smc.vnet.net
- Subject: [mg20034] Re: Contourline values
- From: "Kevin J. McCann" <kevinmccann at Home.com>
- Date: Sat, 25 Sep 1999 18:46:03 -0400
- Organization: @Home Network
- References: <7se5tl$qrp@smc.vnet.net> <7sho0u$1jq@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Allan, I had a look at your example and wonder if you could elaborate a bit on what happened. If I look at cg with FullForm, I get stuff like: cg = ContourPlot[1/((x - 1)(x + 1)), {x, -2, 2}, {y, 0, 1},ContourShading -> False, Contours -> 3]; cg//FullForm Produces: ContourGraphics[List[List[0.333333, 0.515789, ... On the other hand Graphics[cg]//FullForm Produces: Graphics[List[ List[GrayLevel[0.], AbsoluteThickness[0.5], Line[List[List[1.37445, 1.], List[1.37445, 0.928571],... I don't see the correlation. In particular, I don't see how the first {x,y} point in the Line, viz. {1.37445,1.}, is produced from the earlier ContourGraphics. Thanks, Kevin Allan Hayes <hay at haystack.demon.co.uk> wrote in message news:7sho0u$1jq at smc.vnet.net... > > Rita Bijlsma <R.Bijlsma at iri.tudelft.nl> wrote in message > news:7se5tl$qrp at smc.vnet.net... > > Hi! > > > > I can not find a way to get contourline values in contour plots. > > > > Can it be done (automatically) ? > > > > Thanks! > > Rita > > > > -- > > .-. || Drs. Rita Bijlsma tel: +31-15-2787109 > > / \|| IRI dept of Radiation Physics fax: +31-15-2786422 > > | ||| Delft University of Technology email: rita at iri.tudelft.nl > > | |||_The Netherlands ______________ http://www.iri.tudelft.nl/~rita > > > > Rita, > > cg = ContourPlot[1/((x - 1)(x + 1)), {x, -2, 2}, {y, 0, 1}, > ContourShading -> False, Contours -> 3]; > > ContourGraphics[] > > > Contour graphics stores a matriex of heights - no explicit lines. To get the > lines we convert the contour graphics object to a Graphics object and then > use Cases to gert a list of the result of passing the first point > coordinates for each line to the expression being plotted. Since there may > be, as here, more than one line at the same height, we then use Union to > remove duplicates. > > Cases[Graphics[cg], > Line[{{x_, y_}, ___}] :> (1/((x - 1)(x + 1))), > Infinity] // Union > > > Out[28]= > {-10175.9, -10175.9, -7.48556, -7.48556, -1.63844, -1.63844, 1.1247, 1.1247, > \ > 6.99341, 6.99341} > > > -- > 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 > > >