Skip to content

scatter plot to contour plot

4 messages · azam jaafari, Duncan Murdoch, Clint Bowman +1 more

#
On 24/02/2014 12:45 PM, azam jaafari wrote:
A contour plot of values associated with the points, or a contour plot 
of the density of the points?  For the former, I think you want to use 
the akima package; for the density estimate, you could use kde2d from 
the MASS package.

In either case, you need to compute the values of the function on a 
grid, then the contour() function can plot it.

Duncan Murdoch
#
Azam,

If you also have z ~ f(x,y) you can produce contours.

Otherwise, you could look at package hexbin.

Clint

Clint Bowman			INTERNET:	clint at ecy.wa.gov
Air Quality Modeler		INTERNET:	clint at math.utah.edu
Department of Ecology		VOICE:		(360) 407-6815
PO Box 47600			FAX:		(360) 407-7534
Olympia, WA 98504-7600

         USPS:           PO Box 47600, Olympia, WA 98504-7600
         Parcels:        300 Desmond Drive, Lacey, WA 98503-1274
On Mon, 24 Feb 2014, azam jaafari wrote:

            
#
In addition to the other responses, I'd like to suggest:

  help.search('contour', package='graphics')

Since the graphics package comes with R, you don't necessarily need any
additional package for contouring. But you will need the akima package for
interpolation. Assuming you're doing a contour plot of values associated
with the points, as Duncan put it.

-Don