Re: plotting lat/lon positions on a contour map

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu, 13 Apr 2006 15:41:22 -0600 (MDT)

Hi Ivan,

If all you are trying to do is draw a marker for each of these
arbitrary points, then you don't need to use Ngl.xy. You can use
Ngl.polymarker for this. You can see the "contour_xyz.py" Python
script for an example:

    pynglex contour_xyz

or see the graphic and code in the gallery at:

    http://test.tpyngl.ucar.edu/Examples/gallery.shtml

Here's a short example: assuming your contour data is called "zt", and
the points are represented in latitutde and longitude coordinates
"lat" and "lon, then you do something like this:

wks = Ngl.open_wks("ps", "contour_xyz")

res = Ngl.Resources()
res.nglFrame = False # Don't advance frame.
...Set other resources...

contour = Ngl.contour_map(wks,zt,res)

poly_res = Ngl.Resources()
poly_res.gsMarkerIndex = 16
poly_res.gsMarkerSizeF = 0.015
Ngl.add_polymarker(wks,contour,lon,lat,poly_res)

Ngl.draw(contour)
Ngl.frame(wks)

--Mary

On Thu, 13 Apr 2006, Ivan Lima wrote:

> Hello all,
>
> What is the best/easiest way to plot the positions of
> arbitrary points on a contour map? Trying to overlay (with
> Ngl.overlay) a Ngl.xy plot on a Ngl.contour_map plot gives me:
>
> fatal:NhlAddOverlay: transform is already an annotation or overlay: 11
>
> And the points are not plotted. The error message indicates
> that I'm trying to overlay the xy plot onto a plot is already an
> overlay. Any ideas on how to do this?
>
> Thanks,
>
> - Ivan
>
> --
> Ivan Lima
> Woods Hole Oceanographic Institution, MC&G MS #25
> 360 Woods Hole Road, Woods Hole, MA 02543-1543 USA
>
> _______________________________________________
> pyngl-talk mailing list
> pyngl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
>
_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Thu Apr 13 2006 - 15:41:22 MDT

This archive was generated by hypermail 2.2.0 : Thu Apr 13 2006 - 15:42:48 MDT