Sean Elvidge writes:
> I was wondering if anyone could correct what I am doing wrong here. I am trying to plot multiple maps on a single plot. Usually (in an 'ordinary' IDL window) the following works (as a simple example):
>
> !P.Multi=[0,2,1]
> Map_Set,/Mercator,/Continents,/Advance
> Map_Set,/Mercator,/Continents,/Advance
>
> So now I would like to replicate the above, in a cgWindow. This is what I've tried:
>
> cgWindow,WMulti=[0,2,1]
> cgMap_Set,/Mercator,/Continents,/Advance,/AddCmd
> cgMap_Set,/Mercator,/Continents,/Advance,/AddCmd
>
>
> But this does not work, and instead just plots a full sized map.
>
> Any ideas?
You are not doing anything wrong. You are just not doing what I do. ;-)
There is a bug in your version of cgMap_Set. I simply forgot to check
the status of !P.Multi before I plunged in to set a Position for the map
projection. You can find an updated version here:
http://www.idlcoyote.com/programs/cgmap_set.pro
That said, using !P.Multi with Map_Set and Advance is a little
problematic, because Map_Set has apparently been hardwired pretty well
to prefer black backgrounds and it will use a black background even when
you might prefer something else!
If a black background is what you want, you should use cgMap_Set like
this:
cgWindow,WMulti=[0,2,1]
cgControl, Execute=0
cgMap_Set,/Mercator,/Continents,/Advance,/AddCmd,Color='whit e'
cgMap_Set,/Mercator,/Continents,/Advance,/AddCmd
cgControl, Execute=1
If you prefer white backgrounds, as I do, you should use cgMap_Set like
this:
cgWindow,WMulti=[0,2,1]
cgControl, Execute=0
cgMap_Set,/Mercator,/Continents,/AddCmd
cgMap_Set,/Mercator,/Continents,/AddCmd, /NoErase
cgControl, Execute=1
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|