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

Home » Public Forums » archive » Re: grid plots
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: grid plots [message #41989 is a reply to message #41988] Thu, 09 December 2004 06:46 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <1102591840.222724.104440@f14g2000cwb.googlegroups.com>,
"Martin" <m.doyle@uea.ac.uk> wrote:

> Hello everyone,
>
> I've been trying to find a way of doing this for ages, but my head is
> sore after banging it against my computer screen!
>
> I have an irregularly gridded dataset (gaussian grid) and I want to be
> able to 1) interpolate it onto a regular grid and 2) plot the data so
> that each grid square is coloured depending on the value within each
> square.
>
> I have a problem with 2) in that I can't find any IDL routines that do
> this. Does anyone happen to know how to go about this at all? I'd be
> grateful for a any suggestions you might have.

There are two ways to do this that come to mind.

One is to use POLYFILL to draw a polygon for each grid cell with the
desired color. This is probably not the best way, as the PS device only
supports 256 colors for line graphics, and it may look ugly on some map
projections (e.g., when grid cells are not rectangles).

The other way is to create an image, but not interpolate the data:

MAP_SET, /HAMMER, LIMIT=limit, /ISOTROPIC, /NOBORDER

data = DIST(15)
bilinear = 0
proj = MAP_IMAGE(data, i0, j0, ni, nj, $
COMPRESS=1, BILINEAR=bilinear, $
LATMIN=-90.0, LONMIN=0.0, LATMAX=90.0, LONMAX=360.0)

image = BYTSCL(proj)
IF (!D.NAME EQ 'PS') THEN $
TV, image, i0, j0, XSIZE=ni, YSIZE=nj $
ELSE $
TV, image, i0, j0

MAP_CONTINENTS
MAP_GRID, GLINESTYLE=0


Change bilinear to 1 to see the effects of interpolating. You can do
something more complicated than a simple BYTSCL to define the colors for
your data.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: To PVM or not to PVM
Next Topic: Convolution of two equally sized arrays

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

Current Time: Wed Oct 08 17:56:23 PDT 2025

Total time taken to generate the page: 0.00444 seconds