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

Home » Public Forums » archive » Interesting IDLgrContour Bug
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Interesting IDLgrContour Bug [message #21813] Tue, 19 September 2000 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Hi Folks,

I ran into an interesting little IDLgrContour bug today
that gave me a few hours of fun. Apparently, the
contour algorithm cannot see positive data that is less
than 1. As a result, it reports the contour range incorrectly.
Here is a very short example:

; Create test data.
data = Dist(40)

; Normalize the Y values from 20 to 39 to be less than 0.
data[*,20:39] = data[*,20:39]/Max(data)

; Create contour plot.
x = findgen(40)
y = findgen(40)
theContour = Obj_New('IDLgrContour', data, Geomx=x, Geomy=y)

; Get the Y range of the data.
theContour->GetProperty, YRange=theBadRange

; Print it. Expect 0 to 39.

Print, theBadRange
0.000000 19.8495

Whoops! Of course, this will cause the scaling to be
completely off when you go to put the plot into your
view.

The work around is to get the contour range from
the X and Y vectors. I don't think too many people
will run into this, but it can be distracting. :-)

I've tested this in IDL 5.3.1 and IDL 5.4 beta on
Windows NT 4.0.

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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: ASSOC
Next Topic: Announcement from RSI

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

Current Time: Fri Oct 10 07:09:24 PDT 2025

Total time taken to generate the page: 0.79842 seconds