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

Home » Public Forums » archive » strange things in CONTOUR
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: strange things in CONTOUR [message #42519 is a reply to message #42515] Mon, 14 February 2005 07:57 Go to previous messageGo to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
Sverre Solberg wrote:

> Perhaps I have done a very basic and stupid error in the program below,
> or there's some very mysterious explanation.
>
> The problem in a stripped version is simply to plot a contour plot on
> top of another plot. As basic as that. However, the following code does
> not show the contour fields (at least not on my screen):
>
> loadct, 0
> f = dist(100, 100)
> pencolor = 0
> background = !D.n_colors-1
> y = findgen(100)
> plot, y, color = pencolor, background = background
> contour, f, /overplot, color = pencolor
>
> The mysterious part is that when I add the line:
> contour, f, color = pencolor, background = background, /nodata
> anywhere *before* the plot command, it works perfectly ok.
>
> What is wrong?
>
> (IDL 5.5 for Unix)
>

Hi,

I'm not sure what could be wrong but shall point out two things:

!D.N_COLORS is not necessarily the same thing as !D.Table_Size, in this case you
are using indexed coloring - so you should use !D.Table_Size

Using OVERPLOT requires you to specify the contour levels (LEVELS) or number of
levels (NLEVELS) according to the online help...

"You must explicitly specify either the values of the
contour levels or the number of levels (via the NLEVELS keyword)
when using this option, unless geographic mapping coordinates
are in effect."

The second thing is interesting because David says it works fine for him
(presumably without specifying levels.) I believe that that is one of his
rewards for being one with IDL - IDL simply intuits his desires.

Cheers,
Ben
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: A simple IF statement question
Next Topic: Re: strange things in CONTOUR

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

Current Time: Sat Oct 11 07:12:21 PDT 2025

Total time taken to generate the page: 0.40021 seconds