Skip to content
Back to formatted view

Raw Message

Message-ID: <C27E9D59-24B6-4B7C-A228-6E42D1EE3F22@ysidro.econ.uiuc.edu>
Date: 2005-05-06T20:39:00Z
From: Roger Koenker
Subject: plotting image/contour on irregular grid
In-Reply-To: <Pine.LNX.4.44.0505062140330.25599-100000@reclus.nhh.no>

On May 6, 2005, at 2:45 PM, Roger Bivand wrote:

> On Fri, 6 May 2005, m p wrote:
>
>> Hello,
>> I'd like to make a z(x,y) plot for irregularly spaced
>> x,y. What are routines are available in R for this
>> purpose?
>>
>
> One possibility is to interpolate a regular grid using interp() in the
> akima package, then use image() or contour(). Another is to use
> levelplot() with formula z ~ x + y in the lattice package, and the
> equivalent contourplot(); here, the x,y pairs must lie on a grid,  
> but do
> not need to fill the grid (so are regularly spaced with missing grid
> cells).
>>

You could also try tripack and rgl.triangles to produce piecewise linear
surfaces on the Delaunay triangulation of the x,y points.

Roger