Re: overlay different maps

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 22 Aug 2007 10:25:09 -0600 (MDT)

> hi,
> is it possible to overlay to different contour_map plot? generic overlay
> function does not allow this kind of plot.
> best regards,
> ufuk utku turuncoglu


Hi Ufuk,

I'm not sure what you mean by "different contour_map plot". I believe
once you've overlaid an object on another one, you can't then overlay
it on different one. You will need to recreate it.

That is, if you have something like this:

   map1 =,res1)
   map2 =,res2)
   contour = Ngl.contour(wks,t,cnres)

You can't then do this:


as you will get an error:

    fatal:NhlAddOverlay: tranform is already an annotation or overlay: 84

You will instead need to do this:

   map1 =,res1)
   map2 =,res2)
   contour1 = Ngl.contour(wks,t,cnres) ; contour1 and contour2
   contour2 = Ngl.contour(wks,t,cnres) ; are identical

Some more background: when you call Ngl.contour_map, what's returned
is effectively the id for the map plot. Since you can't overlay one
map on another map, you can't overlay two Ngl.contour_maps on each

You don't really need to generate the map multiple times anyway. What
you want to do is generate a map plot once, with a call to something
like Ngl.contour_map or, and then generate the second plot you
want to overlay with a call to something like Ngl.contour.

Please see the "" example at:

In this script you will see the code:

map_plot =,mpres)
vector_plot = Ngl.vector(wks,ua,va,vcres)
line_contour_plot = Ngl.contour(wks,pa,clres)
fill_contour_plot = Ngl.contour(wks,ta,cfres)
# Overlay everything on the map plot.

Note that the map_plot is being used as the base for all of the
overlays. This is necessary when you do overlays involving a map.


On Wed, 22 Aug 2007, [BE] Ufuk Utku Turuncoglu wrote:

pyngl-talk mailing list
Received on Wed Aug 22 2007 - 10:25:09 MDT

This archive was generated by hypermail 2.2.0 : Thu Aug 23 2007 - 10:48:58 MDT