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

Home » Public Forums » archive » Contour plots on irregular ranges
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
Contour plots on irregular ranges [message #753] Thu, 25 February 1993 09:04 Go to next message
galambos is currently offline  galambos
Messages: 1
Registered: February 1993
Junior Member
I'm considering getting PV-Wave, but am concerned whether it can
do contour plots over irregular ranges of data (i.e. z values for
non-square sets of x-y points). I've only got access to a demo version
with summary "manuals" - and the only contour examples I've seen are
over nice square/rectangular (x,y) ranges.

Thanks, John Galambos (email - galambos@ornl.gov)
Re: Contour plots on irregular ranges [message #948 is a reply to message #753] Sun, 28 February 1993 19:46 Go to previous message
sterne is currently offline  sterne
Messages: 15
Registered: March 1992
Junior Member
In article <galambos.730659865@moonshine> galambos@moonshine.llnl.gov (John Galambos - OR - Iter) writes:

I'm considering getting PV-Wave, but am concerned whether it can
do contour plots over irregular ranges of data (i.e. z values for
non-square sets of x-y points). I've only got access to a demo version
with summary "manuals" - and the only contour examples I've seen are
over nice square/rectangular (x,y) ranges.


Wave/IDL can deal with nice square/rectangular, but can also deal with
some irregular grids as well. When you call contour, you can call it
with X and Y as vectors, which will generate a rectangular grid, or with
either X or Y (or both) as arrays, where each element will specify the
appropriate X (Y) component for the corresponding Z array index.

If the grid is truly random, wave has a problem deciding where the
boundary is and which points should be connected to which; the resulting
contours look like a jumble of intersecting lines. However, if you can
think of your grid as some sort of distorted rectangular grid, it does a
fine job of contouring the data. For example, if you can view your grid
as a stretched or distorted rectangular grid, it will work well. If
your grid is more random than this, you may well have problems.

Example: Contour r^2 within an arc of a circle, 1<r<10, 0<theta<60

r = findgen(10) + 1.0 ; radius
theta = findgen(7)*10.0*!pi/180.0 ; angle in radians
x = r#cos(theta) ; x array
y = r#sin(theta) ; y array
z = x^2 + y^2 ; function to plot
contour,z,x,y

Clearly this is not a simple square/rectangular array, but it is not
random either. Contrast this with what you get by trying the following:

x = randomu(seed,5,5)
y = randomu(seed,5,5)
z = randomu(seed,5,5)
contour z,x,y

which looks like a one-year-old scribbled on the screen.

So Wave/IDL can contour irregular grids, but best results are obtained
when the (x,y) points are still relatively well ordered, and not
randomly arranged.


Phil
--
Philip Sterne | sterne@dublin.llnl.gov
Lawrence Livermore National Laboratory | Phone (510) 422-2510
Livermore, CA 94550 | Fax (510) 422-7300
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: RE: SAVE/RESTORE files in C/FORTRAN (USING XDR!)
Next Topic: I'm writing an FAQ for IDL

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

Current Time: Fri Oct 10 18:36:39 PDT 2025

Total time taken to generate the page: 1.51770 seconds