Re: filled contour chart problems [message #43110] |
Tue, 15 March 2005 13:28 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Jill writes:
> Yes, but I was doing it all wrong for a good reason, which I forgot to
> mention. :)
Oh, right. Of course. :-)
> Originally I was using /overplot in the first contour
> command, but when I do that, the contour lines do not show up (but the
> colored filled area does), and the grid lines only cover the land, not
> the sea.
Yes, you will have to do one CONTOUR with CELL_FILL and
OVERPLOT to draw the filled contours. Then another with
just OVERPLOT to draw the contour lines.
> So not thinking /overplot would help, I tried it just now
> again and like magic, it worked...but only for 7 out of 10 of the
> images (different geographic regions). Some of them still have the
> original problem of having partial grid lines and no contour lines.
Could be all kinds of reasons for this. You are allowing
IDL to choose contour intervals, for example. Could be some
clipping problems going on. Hard to say without seeing all
of your code.
> They all now have a slightly smaller colored contoured area than the
> lat/lon box, which I can live with, unless that is part of the problem.
I would say the lat/lon values you pass for CONTOUR do not correspond
to the map limits you are using in MAP_SET if this is the case. You
should see perfect alignment if you do it correctly.
> I am getting the floating underflow error again.
Yes, well, we *all* get underflow warnings (they are seldom
errors). You might have to live with this one, or learn to turn
all warnings off (you have to prove you know what you are doing
before I tell you how to do this :-). I do notice that even
RSI-supplied code turns these errors off occasionally. (Note
to RSI: couldn't we do something to fix this instead?)
> I will check out the link you posted.
Yes, a search for CONTOUR in general on that web page should
turn up a LOT of interesting reading. :-)
Cheers,
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: filled contour chart problems [message #43111 is a reply to message #43110] |
Tue, 15 March 2005 12:27  |
psbeps
Messages: 8 Registered: March 2005
|
Junior Member |
|
|
Yes, but I was doing it all wrong for a good reason, which I forgot to
mention. :) Originally I was using /overplot in the first contour
command, but when I do that, the contour lines do not show up (but the
colored filled area does), and the grid lines only cover the land, not
the sea. So not thinking /overplot would help, I tried it just now
again and like magic, it worked...but only for 7 out of 10 of the
images (different geographic regions). Some of them still have the
original problem of having partial grid lines and no contour lines.
They all now have a slightly smaller colored contoured area than the
lat/lon box, which I can live with, unless that is part of the problem.
I am getting the floating underflow error again. I will check out the
link you posted.
Jill
|
|
|
Re: filled contour chart problems [message #43114 is a reply to message #43111] |
Tue, 15 March 2005 10:48  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
psbeps@hotmail.com writes:
> I am having problems getting some filled contour charts of sea surface
> temperature to look right on a new Linux machine. They look fine on
> the old machine with the exact same program, and other types of contour
> charts on the new machine are fine. The old machine had IDL Version
> 5.3 and the new machine has IDL Version 6.1.
>
> The contouring and filling is correct, and the graphic size is correct
> (the entire image size), but the graphic position and size of just the
> contoured area (without the color bar etc) is incorrect. I suppressed
> the lat/lon box using xstyle and ystyle=4 in the contour command since
> it does not line up with the (correct) lat/lon box from PLOT.
>
> Also, I can't get it to do the contouring, grid lines, and continents
> all at once. I can either have it do just the continents and grid
> lines, or just the contoured part without continents or grid lines.
> When I take longitude and latitude off of the contour commands, the
> size changes, but is still wrong. When I try to have contouring and
> continents together, I get this error:
> MAP_CONTINENTS: Map transform not established.
> When I try to have contouring and grid lines, I get this error:
> MAP_GRID: map_grid---Current ploting device must have mapping
> coordinates
> It's as if it is not recognizing MAP_SET?
> I can get it to draw solid grid lines using PLOT since MAP_GRID does
> not work (although I wanted dotted lines using MAP_GRID).
> Any help in being able to solve these problems would be greatly
> appreciated. Sometimes I also get an underflow error but not always.
Ah, well, your basic problem is that you are doing this all wrong. :-)
(I use one of Peter Mason's DLLs to ring a "bell" that plays a clip
of Curly of the Three Stooges yelling "No, no, no, you are doing it
all wrong!" We should play that clip now.) And the fact that it
actually worked in IDL 5.3 is probably not as shocking as you might
think.
Basically, what happens when you call the MAP_SET command is that
a data coordinate space (in latitude and longitude) gets created.
You obliterate that data space with your next CONTOUR command,
which sets up its *own* data space. That's why you can't get
any of the MAP_GRID or MAP_CONTINENT commands to work. They think
you are nuts. :-)
What you want to do is overplot (OVERPLOT keyword) your contour
information into the data space that is created by the MAP_SET
command. This will require that you set up X and Y (or more
properly, longitude and latitude) coordinates for your contour
command, but this is easily done. This will not change the MAP_SET
data space, and MAP_GRID and the other map commands will now
work property.
There are a number of articles on contour plots on my web page,
but I would start with this one for the basic ideas:
http://www.dfanning.com/tips/mapcontourdata.html
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|