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

Home » Public Forums » archive » Re: Contour plots on maps
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 plots on maps [message #19983] Tue, 16 May 2000 00:00
Simon de Vet is currently offline  Simon de Vet
Messages: 36
Registered: May 2000
Member
"R.Bauer" wrote:

> You should always use the /cell_fill keyword instead of /fill!!!!

Ding ding! We have a winner! :)

The bizzare part is that cell_fill does not appear in my online help, nor in my
manual.

I am using IDL 5.3, and cell_fill works perfectly, despite not being mentioned
anywhere. It does slow the script down my about 15 seconds, but it's well worth
it.

Thank you!

Simon
Re: Contour plots on maps [message #19985 is a reply to message #19983] Tue, 16 May 2000 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Simon de Vet wrote:
>
> David Fanning wrote:
>
>> There are several articles that you will really want to
>> read on my web page, but I would start with this one,
>> because you definitely have "holes" in your contour plots:
>
> I found this site, and already have incorporated the solution into my code.
> If I plot my filled contours without a map projection, it plots beautifully,
> with no holes or gaps.
>
> This is the problem: first, the lowest few contours are filled in. Then they
> are all overwritten in white, and the next are filled in. These are also
> whited out, and the last couple are plotted. Only the last ones are visible
> when the plotting is complete.
>
> I am outputting all my plots to postscript files, and not to the screen
>
> I have also tried changing the centre of the plot, as you mentioned, so that
> the data border corresponds to the plot border (Greenwhich on the edge,
> instead of the middle.) This eliminates the odd diagonal lines, but does
> nothing to the filled contour troubles.
>
> These problems occur for all map projection types, and never if map
> projection is turned off.
>
> Simon


You should always use the /cell_fill keyword instead of /fill!!!!


ONLINE HELP:

CELL_FILL

Set this keyword to produce a filled contour plot using a "cell filling"
algorithm. Use this keyword instead of FILL when you are drawing filled
contours over a map, when you have missing data, or when contours that
extend off the edges of the contour plot. CELL_FILL is less efficient
than FILL because it makes one or more polygons for each data cell. It
also gives poor results when used with patterned (line) fills, because
each cell is assigned its own pattern. Otherwise, this keyword operates
identically to the FILL keyword, described below.

Tip - In order for CONTOUR to fill the contours properly when using a
map projection, the X and Y arrays (if supplied) must be arranged in
increasing order. This ensures that the polygons generated will be in
counterclockwise order, as required by the mapping graphics pipeline.
Warning - Do not draw filled contours over the poles on Cylindrical map
projections. In this case, the polar points map to lines on the map, and
the interpolation becomes ambiguous, causing errors in filling. One
possible work-around is to limit the latitudes to the range of -89.9
degrees to + 89.9 degrees, avoiding the poles.


regards

R.Bauer
Re: Contour plots on maps [message #19993 is a reply to message #19983] Mon, 15 May 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Simon de Vet (simon@mathstat.dal.ca) writes:

> I found this site, and already have incorporated the solution into my code.
> If I plot my filled contours without a map projection, it plots beautifully,
> with no holes or gaps.
>
> This is the problem: first, the lowest few contours are filled in. Then they
> are all overwritten in white, and the next are filled in. These are also
> whited out, and the last couple are plotted. Only the last ones are visible
> when the plotting is complete.
>
> I am outputting all my plots to postscript files, and not to the screen
>
> I have also tried changing the centre of the plot, as you mentioned, so that
> the data border corresponds to the plot border (Greenwhich on the edge,
> instead of the middle.) This eliminates the odd diagonal lines, but does
> nothing to the filled contour troubles.
>
> These problems occur for all map projection types, and never if map
> projection is turned off.

The problem would appear to be your color table. I recommend
you load your color tables identically on both your display
device and in the PostScript device. I usually do something
like this. Suppose I am using 12 levels.

LoadCT, NColors=12, Bottom=1
contourColors = Indgen(12)+1
Contour, z, x, y, Levels=contourLevels, C_Colors=contourColors, /Fill

Then what I see on my display is identical to what I see in
PostScript.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: Contour plots on maps [message #19994 is a reply to message #19993] Mon, 15 May 2000 00:00 Go to previous message
Simon de Vet is currently offline  Simon de Vet
Messages: 36
Registered: May 2000
Member
David Fanning wrote:

> There are several articles that you will really want to
> read on my web page, but I would start with this one,
> because you definitely have "holes" in your contour plots:

I found this site, and already have incorporated the solution into my code.
If I plot my filled contours without a map projection, it plots beautifully,
with no holes or gaps.

This is the problem: first, the lowest few contours are filled in. Then they
are all overwritten in white, and the next are filled in. These are also
whited out, and the last couple are plotted. Only the last ones are visible
when the plotting is complete.

I am outputting all my plots to postscript files, and not to the screen

I have also tried changing the centre of the plot, as you mentioned, so that
the data border corresponds to the plot border (Greenwhich on the edge,
instead of the middle.) This eliminates the odd diagonal lines, but does
nothing to the filled contour troubles.

These problems occur for all map projection types, and never if map
projection is turned off.


Simon
Re: Contour plots on maps [message #19997 is a reply to message #19993] Mon, 15 May 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Simon de Vet (simon@mathstat.dal.ca) writes:

> I have been trying to plot some contour maps onto different map
> projections, and for the most part, it is working. I have been having
> some troubles, however...
>
> Sometimes, contours try to connect across the map, cutting diagonally
> across other lines, instead of terminating at the edges. These lines are
> not at the borders of the data, merely at the borders of the current
> projection.
>
> I have also had troubles with filled contours on map projections
> (Mercator, in my case). While filled plots look nice with no map
> projection used, with Mercator they are overwritten with white blocks at
> times, leaving only a few spots of colour. The help says that using map
> projections can cause filled contour troubles... Are there any
> workarounds?

There are several articles that you will really want to
read on my web page, but I would start with this one,
because you definitely have "holes" in your contour plots:

http://www.dfanning.com/tips/contour_hole.html

The other problems can probably be solved by always
specifying the center of the map projection with Map_Set.
Here is another article that deals with an image instead
of a contour plot on a map projection, but the idea is
the same:

http:/www.dfanning.com/tips/map_image.html

Cheers,

David

P.S. Welcome to the club. You should be receiving
your Welcome Packet in the mail real soon now. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Array of structures.
Next Topic: Re: IDL5.2.1: Filling Contours on a Map Background

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

Current Time: Wed Oct 08 18:57:22 PDT 2025

Total time taken to generate the page: 0.00628 seconds