Re: [R] contour plot - line passing through z values

From: Duncan Murdoch <>
Date: Thu, 19 Jun 2008 16:09:20 -0400

On 6/19/2008 12:51 PM, Jehol wrote:
> Dear all,
> there is much in these forums about adding a line to a
> contour/filled.contour plot, but I haven't found hints for the following. I
> apologize in advance if I just missed the right one.
> I'm having a standard filled.contour plot to which I want to add a line
> passing through some specific z-values at some specific x, without knowing
> the y coordinates. There should be a way of getting these coordinates
> (within the accuracy defined by nlevels in the initial filled.contour) but
> I'm not sure how to do that, particularly as filled.contour does not return
> any values.
> If anyone's got any idea...please help.

The contourLines function will return x and y values corresponding to a contour. You could search that result for a segment that crosses the x value of interest.

Duncan Murdoch mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Thu 19 Jun 2008 - 21:24:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 19 Jun 2008 - 21:31:34 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive