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

Home » Public Forums » archive » Re: MAP_SET and !P.MULTI?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: MAP_SET and !P.MULTI? [message #11306] Thu, 26 March 1998 00:00
Bob Yantosca is currently offline  Bob Yantosca
Messages: 6
Registered: March 1998
Junior Member
> It is curious and certainly looks like a bug. The problem is
> that !P.Multi[0] is not getting updated properly (among
> several other curiosities). Rather than using the Position keyword,
> I fixed the code by doing this:
>
> !p.multi = [0,2,2]
> window,0,xsize=800,ysize=800
> ; xmin, ymin, xmax, ymax
> map_set, /continents, title='UL', /noerase
> !P.Multi[0] = 3
> map_set, /continents, title='UR', /noerase
> !P.Multi[0] = 2
> map_set, /continents, title=' LL', /noerase
> !P.Multi[0] = 1
> map_set, /continents, title=' LR', /noerase
> print,!p.multi
> end
>
> I don't know why the NoErase is still needed, except that
> something else is clearly not working correctly.
>
> Cheers,
>
> David
> -----------------------------------------------------------
> David Fanning, Ph.D.
> Fanning Software Consulting
> E-Mail: davidf@dfanning.com
> Phone: 970-221-0438
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
>
>

For some reason, MAP_SET has never really advanced correctly
according to !P.MULTI (even in version 3.6 and 4.1).

What I've done to combat against this is the following
set advance keyword = 0 if !P.MULTI(0) = 0
= 1 otherwise

as is illustrated in the test program below:

=======================
pro testnew
; prints 4 maps in the UL, UR, LL, LR positions

!p.multi = [0, 2, 2, 0, 0]

for I = 0, 3 do begin
if (!P.MULTI(0) eq 0) then advance = 0 else advance = 1

map_set, 0, 0, 0, /grid, /cont, advance=advance
endfor
end
===============

Regards,

Bob Y.
Re: MAP_SET and !P.MULTI? [message #11345 is a reply to message #11306] Mon, 23 March 1998 00:00 Go to previous message
wmc is currently offline  wmc
Messages: 117
Registered: February 1995
Senior Member
In article 70F6@magus.stx.com, Jack Saba <jack@magus.stx.com> writes:
> The following code (run with IDL 5.0.2) produces a plot with one image
> in the UL, and three images overplotted in the UR quadrant. Anyone
> understand why MAP_SET does not seem to work in conjuction with
> !P.MULTI?
>
> !p.multi = [0,2,2]
> map_set, /continents, title='UL', /noerase
> map_set, /continents, title='UR', /noerase
> map_set, /continents, title=' LL', /noerase
> map_set, /continents, title=' LR', /noerase

You need to say ",/advance". Then it all works fine.

- William

---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
Re: MAP_SET and !P.MULTI? [message #11351 is a reply to message #11345] Sun, 22 March 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Jack Saba (jack@magus.stx.com) wrote the other day:

> The following code (run with IDL 5.0.2) produces a plot with one image
> in the UL, and three images overplotted in the UR quadrant. Anyone
> understand why MAP_SET does not seem to work in conjuction with
> !P.MULTI?
>
> !p.multi = [0,2,2]
> window,0,xsize=800,ysize=800
> ; xmin, ymin, xmax, ymax
> map_set, /continents, title='UL', /noerase
> map_set, /continents, title='UR', /noerase
> map_set, /continents, title=' LL', /noerase
> map_set, /continents, title=' LR', /noerase
> print,!p.multi
> end
>
> The code can be made to work of course by using the POSITION keyword
> rather than !P.MULTI, but it seems curious that the code above doesn't
> work.

And then I wrote some nonsense like this:

> It is curious and certainly looks like a bug. The problem is
> that !P.Multi[0] is not getting updated properly (among
> several other curiosities).

My friend Andrew Cool at the DSTO in Adelaide, Australia
points out in the gentlest manner possible that I ought to
take my own advice and read the documentation before I jump
in with both feet. He suggests that the ADVANCE keyword
to MAP_SET might be just what we are looking for. Sure
enough, try this:

!p.multi = [0,2,2]
window,0,xsize=800,ysize=800
; xmin, ymin, xmax, ymax
map_set, /continents, title='UL', /advance
map_set, /continents, title='UR', /advance
map_set, /continents, title=' LL', /advance
map_set, /continents, title=' LR', /advance
END

But I am still left wondering, why ADVANCE?!

"Thanks, Andrew," he said sheepishly.

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: MAP_SET and !P.MULTI? [message #11364 is a reply to message #11351] Fri, 20 March 1998 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Jack Saba (jack@magus.stx.com) writes:

> The following code (run with IDL 5.0.2) produces a plot with one image
> in the UL, and three images overplotted in the UR quadrant. Anyone
> understand why MAP_SET does not seem to work in conjuction with
> !P.MULTI?
>
> !p.multi = [0,2,2]
> window,0,xsize=800,ysize=800
> ; xmin, ymin, xmax, ymax
> map_set, /continents, title='UL', /noerase
> map_set, /continents, title='UR', /noerase
> map_set, /continents, title=' LL', /noerase
> map_set, /continents, title=' LR', /noerase
> print,!p.multi
> end
>
> The code can be made to work of course by using the POSITION keyword
> rather than !P.MULTI, but it seems curious that the code above doesn't
> work.

It is curious and certainly looks like a bug. The problem is
that !P.Multi[0] is not getting updated properly (among
several other curiosities). Rather than using the Position keyword,
I fixed the code by doing this:

!p.multi = [0,2,2]
window,0,xsize=800,ysize=800
; xmin, ymin, xmax, ymax
map_set, /continents, title='UL', /noerase
!P.Multi[0] = 3
map_set, /continents, title='UR', /noerase
!P.Multi[0] = 2
map_set, /continents, title=' LL', /noerase
!P.Multi[0] = 1
map_set, /continents, title=' LR', /noerase
print,!p.multi
end

I don't know why the NoErase is still needed, except that
something else is clearly not working correctly.

Cheers,

David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: country boundary
Next Topic: "Structure references nested too deeply"?

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

Current Time: Wed Oct 08 18:39:12 PDT 2025

Total time taken to generate the page: 0.00646 seconds