[R] contour() & contourLines()

Peter Ehlers ehlers at ucalgary.ca
Thu Oct 22 20:53:25 CEST 2009

Hi Ted,

Here's what the last example in ?contour says:

  "## contourLines produces the same contour lines as contour"

So, even without digging into the source, I would guess
that your hunch is correct.

Peter Ehlers

(Ted Harding) wrote:
> Hi Folks,
> I have been using contour() to produce some contour plots
> (of a spatially-smooted density produced by kde2d()), with
> very satisfactory results.
> I now want access to the coordinates of the points on the
> contours, and it would seem that contour() does not return a
> value, so there is nothing from which these could be extracted.
> However, apparently contourLines() does, and it seems to be
> invoked in essentially the same way (so far as the x,y,z
> and levels parameters are concerned).
> However, I am not sure whether the contour lines generated
> by contourLines() are the same numerically as those generated
> (at any rate plotted) by contour().
> By over-plotting the coordinates from contourLines() on the
> contours plotted by contour(), it looks as though they may be
> the same.
> Advice would be appreciated!
> With thanks,
> Ted.
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 22-Oct-09                                       Time: 19:03:37
> ------------------------------ XFMail ------------------------------
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list