Skip to content

get vector data from contour

3 messages · Thomas Petzoldt, Ross Ihaka, Duncan Murdoch

#
I have carried out a spatial interpolation (Kriging) using surf.gls() 

The contour plot looks very plausible and the image plot is o.k too. 
The problem is, hovever, that I need the vectorized isoplethes, as in
contour().
Unfortunately, I found no solution to get the internal data from
contour().

Is there a possibility to extract contour lines as x-y-polygon from a
grid without hacking plot3d.c?

Thank you in advance!

Thomas P.
#
On 2001.02.06 00:26:45 +1300 Thomas Petzoldt wrote:

            
I can't offer another solution, but I would be very interested in anything
you come up with. I would like to see all R graphics code separated into
computation and drawing components. This would make a number of things
easier - eg. replacing the current drawing system with something better.

I the case of contour, I can see a couple of issues. (1) joining contour
lines which intersect the boundary by following the boundary (2) dealing
with missing values.

	Ross

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
1 day later
#
On Tue, 6 Feb 2001 08:45:20 +1300, Ross Ihaka wrote in message
<20010206084520.A309 at arche.ihaka>:
An alternative to this would be to provide access to the internals of
graphics objects.  I'm not familiar with the current internals of
plots in R, but the model I'm trying to implement in a 3D package is
to make graphics objects completely open to manipulation.  Since the
3D renderer needs to redraw the image every time it moves anyways, why
not allow the user to change what gets redrawn?  But this would be
useful even in static 2D plots, for example to rescale when new data
is added.

My current implementation has all of the data residing outside of R's
memory space, with various external functions to read and write it.
It would be better to have it entirely internal (since I'm sure it's
easy to get memory leaks now), but I'm not ready to manipulate R
internal objects yet.

There are basically two types of objects to manipulate:  primitives
(which are represented as vectors of data) like points, lines and
polygons, and groups, which are lists of objects together with a
transformation matrix.  Since groups can contain both primitives and
other groups, there's a hierarchical structure.

The low level functions add a primitive to the currently active group,
and return a pointer to it.  Users can use that pointer to move points
around, change colours, etc.

The high level functions draw lots of primitives, and return a
structure with pointers to the outermost group, and sometimes pointers
to key elements within it, or other helpful things.  (The design
hasn't settled down yet!)

One issue that I don't know how to address if this was done entirely
with R objects is what to do about all those pointers.  

Duncan Murdoch
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._