Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Exporting ContourPlot data into text file to plot somewhere else..

  • To: mathgroup at smc.vnet.net
  • Subject: [mg91357] Re: Exporting ContourPlot data into text file to plot somewhere else..
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Sun, 17 Aug 2008 06:41:29 -0400 (EDT)
  • References: <g86832$hq8$1@smc.vnet.net>

Hi,


cntrplt = ContourPlot[
    x*Exp[-x^2 - y^2], {x, -3, 3}, {y, -2, 2}, ContourShading -> False,
     Contours -> 64];

lst = Cases[cntrplt /. gc_GraphicsComplex :> Normal[gc], _Line,
     Infinity] /. Line :> List;

and to see if it had worked
Graphics[Line @@@ lst]

Regards
   Jens


malawk at gmail.com wrote:
> Hi
> 
> How can I export ContourPlot data to a text file?
> 
> I read some instructions in this forum to do this for normal plots:
> 
> e.g.:
> 
> plt = Plot[Sin[x], {x, 0, 5}]
> First[Cases[plt, _Line, Infinity] /. Line[pnts_] :> pnts]
> 
>  which return a neat list of pairs of numbers to plot somewhere else.
> With ContourPlot though, this command returns only one column of
> numbers in sequencial order... Not good...!
> 
> Thanks for any tip you can offer..
> 
> Angel
> 
> 


  • Prev by Date: Inclusion-Exclusion Principle in Mathematica
  • Next by Date: Re: Connecting pipes
  • Previous by thread: Exporting ContourPlot data into text file to plot somewhere else..
  • Next by thread: Re: Exporting ContourPlot data into text file to plot somewhere else..