comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: contour of 2D data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: contour of 2D data [message #70532] Wed, 21 April 2010 06:59
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Apr 21, 6:33 am, jimmy <mandril...@yahoo.co.uk> wrote:
> Hi folks,
>
> I have a set of data points in the x,y plane and I would like to do a
> contour plot, to highlight zones where there are more or less points.
> One obvious way of doing it, would be to do a grid, count how many
> points follow in a given grid and then use the contour.
>

Contours show the spatial variation of some variable. In your case,
the variable seems to be the density of points. You do no have it
initially, all you have is the location of points. So you need to
decide how you want to generate a density variable from the locations.
The simplest is to use a 2D histogram, which is one case you
considered. For that, see IDL's hist_2d, or David's hist_nd (http://
www.dfanning.com/documents/programs.html#HIST_ND).

Another possibility is to use a kernel, that will weight the points'
addition to the density as a function of their distance from the
sampled point (the histogram actually does this, for a rectangular
kernel). There are other ways to do it, but the choice depends on what
makes more sense to your problem.


> But I was wondering if IDL has already the capability of doing so, by
> avoiding me to go throught the gridding. I though to give to each
> point (x_i,y_i) a weight z_i=1 and then simply
>
> contour,z,x,y,/irregular
>
> but just does not work. Any help?

This defines your z variable as a constant (1), as it has that same
variable for every location you provide it. Which makes for a very
boring contour plot, and probably not what you want.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: contour of 2D data
Next Topic: Re: Unsigned Integer Math Problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:32:54 PDT 2025

Total time taken to generate the page: 0.00525 seconds