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

Home » Public Forums » archive » Re: Multiple cgMap Plots in a cgWindow
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: Multiple cgMap Plots in a cgWindow [message #83544] Mon, 11 March 2013 10:53
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> You are not doing anything wrong. You are just not doing what I do. ;-)

I meant to elaborate on this a little bit. I find I'm not using !P.Multi
much anymore. I tend to use cgLayout because it gives me a great deal
more control over the locations of the multi-plots, the gap spacing, the
outside spacing, etc. It is just a lot more powerful and easy to use.
Plus, it makes it easy to include things like color bars and other
annotations with contour and image plots. This is generally hard to do
with !P.Multi.

You will see me using this a lot in the example plots in the Coyote Plot
Gallery:

http://www.idlcoyote.com/gallery/index.html

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.")
Re: Multiple cgMap Plots in a cgWindow [message #83546 is a reply to message #83544] Mon, 11 March 2013 10:39 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Full-Disk Orthographic to Cylindrical Projection
Next Topic: Broad Peak Search Algorithm

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

Current Time: Wed Oct 08 17:35:12 PDT 2025

Total time taken to generate the page: 0.00568 seconds