MathGroup Archive 1997

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

Search the Archive

Re: Re: Getting values from a Plot

  • To: mathgroup at
  • Subject: [mg7495] Re: [mg7483] Re: Getting values from a Plot
  • From: Allan Hayes <hay at>
  • Date: Sat, 7 Jun 1997 03:48:14 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

There can be problems with using	
to get the list of coordinates when the plot is in two parts (eg.  
Sqrt[x^2-1]), which we may not detect in advance, or when PlotStyle  
has been used.
The alternative
	Cases[Plot[....], Line[x]->x, Infinity]
deals with these.
Of course it will pick up all lines, for example, any from Epilog  
and Prolog - these could be excluded by
	Cases[Plot[....][[1]], Line[x]->x, Infinity]

(1) the plot may be in two parts.

pl = Plot[Sqrt[x^2-1],{x,-2,2}]


We get the coordinates of only the first one


	{{-2.,1.},{-1.83773,0.915277},... ,{-1.00082,0.0286183}}

(2) We may have used PlotStyle

pl2 =Plot[Sin[x],{x,-1,1},PlotStyle->Hue[0]]


Allan Hayes
hay at
voice:+44 (0)116 2714198
fax: +44 (0)116 2718642
12 Copse Close, Leicester, LE2 4FB, UK

  • Prev by Date: Unfinished machine arithmatic
  • Next by Date: Re: Re: Abs and Sign anomolies
  • Previous by thread: Re: Getting values from a Plot
  • Next by thread: How can I get Mathlink Developer's Kit for v3.0 student ?