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

Home » Public Forums » archive » Re: Overplot behalfs strange
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: Overplot behalfs strange [message #73265 is a reply to message #73262] Thu, 04 November 2010 04:02 Go to previous messageGo to previous message
sirvival is currently offline  sirvival
Messages: 18
Registered: August 2010
Junior Member
On 3 Nov., 17:51, David Fanning <n...@dfanning.com> wrote:
> sirvival writes:
>> I am trying to plot an array and then do an overplot with a contour of
>> the same data.
>
>> My code is like this
>
>> colors
>> y = indgen((ey-5)-(sy+5)+1)+(sy+5)
>> window,5,xsize=1280,ysize=1000
>> loadct,0
>> display,ordim[sx:ex,sy+5:ey-5],x,y,/log,xtitle='Pixel',ytitl e='Pixel'
>> colors
>> contour,ordim[sx:ex,sy+5:ey-5],x,y,nlevels=15,thick=2.5,col= 2,/
>> overplot
>
>> This does not work like I want it too. The contour does not get ploted
>> as it seems.
>
>> But if I do another plot in advance that looks the same but uses the /
>> noerase keyword with contour I get what I am looking for.
>> e.g.
>> window,0
>> display,ordim
>> contour,ordim,nlevels=20,/noerase
>
>> If I close idl it gets "reseted" and I have to do the /noerase plot
>> again to get my plot working.
>
>> Its not an big issue but I wonder whats happening.
>
>> What I want is:
>> http://img841.imageshack.us/img841/9059/contour.jpg
>
> Ah, yes, timely question. I am working on this section
> of my book now. You are going to like it. :-)
>
> The problem you have is that "Display" is probably
> just displaying an image, not setting up a data
> coordinate space. Hence, there is nothing for Contour
> to "overplot" on. No data coordinate space!!
>
> With images, it is typically necessary (because
> image don't create data coordinate spaces in IDL),
> to "draw" a data coordinate space over the top of them.
> We try to do this invisibly, of course, so we usually
> turn the axes completely off. Your commands should be
> something like this:
>
>   contour,ordim[sx:ex,sy+5:ey-5],x,y,nlevels=15,thick=2.5,$
>       col=2, xstyle=5, ystyle=5, /nodata
>   display,ordim[sx:ex,sy+5:ey-5],x,y,/log,xtitle='Pixel',$
>      ytitle='Pixel'
>   contour,ordim[sx:ex,sy+5:ey-5],x,y,nlevels=15,thick=2.5,$
>       col=2,/overplot
>
> Or, you could just continue to use that NOERASE keyword.
> That's what I would probably do. You just need to remember
> to erase your display window before you display your image,
> since I doubt Display remembers to do that for you either.
>
> By the way, you are doing your contour plots all wrong, too. :-)
>
> http://www.dfanning.com/documents/tips.html#CONTOURPLOTTIPS
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks.
Strange thing is I used /noerase on a different window in my code and
it still does what I want (display is from
http://www.astro.uu.se/~piskunov/RESEARCH/REDUCE/display.pro).
Even if it is in a differnt pro that I run prior.

With wrong you mean nlevels?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: paging question
Next Topic: N-body integrator

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

Current Time: Sun Oct 12 09:39:12 PDT 2025

Total time taken to generate the page: 0.80014 seconds