Anyone doing color-filled contours in IDL? [message #1315] |
Fri, 10 September 1993 12:30 |
paul
Messages: 22 Registered: June 1991
|
Junior Member |
|
|
I am having trouble with
z=fltarr(3,3)
z(1,1)=-50.
tvlct , r,g,b,/get
r(10)=255
g(10)=0
b(10)=0
r(11)=0
g(11)=0
b(11)=255
tvlct,r,g,b
contour, z, lev=[-60,-30] , c_col=[ 10,11],/fill
z(1,2) = -50
contour, z, lev=[-60,-30] , c_col=[ 10,11],/fill
In the first case I get a red diamond in the middle of the plot,
but no blue
In the second case I get a blue 'U'-shaped form with no red.
As I understand it, I should get a red diamond inside a blue
background in the first plot and red filling the inside of the blue
'U' in the second plot.
In the first case, I guess that there is a problem when the first
contour in PATH_FILENAME has CONTOUR_HEADER.HIGH = 0, and it just
simply decides to fill it with the color apprpopriate for the
values just below the contour level. It never bothers to fill the
rest of the region.
In the second case, the /CLOSE keyword probably closes the contour and
sets the value of CONTOUR_HEADER.HIGH to 1 , and so does a polyfill
on this, never bothering to check to see what to use fo fill the
rest of the plot.
support@rsinc.com has confirmed that there is a bug in CONTOUR
when /CLOSE and PATH_FILENAME are used because the value of
CONTOUR_HEADER.HIGH is somtimes wrong. This means that the incomplete
contours around the edge of the plot sometimes get the wrong
color.
Does anyone have a working procedure to do color-filled contours?
------------------------------------------------------------ -----------
Paul Schopf
NASA GSFC
|
|
|