Re: Polymarkers

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue, 4 Nov 2008 07:34:08 -0700

Hi Yuval,

There are a few examples. See the "polylines, polymarkers" section of
the gallery:

http://www.pyngl.ucar.edu/Examples/gallery.shtml

Example xy2 shows how to do filled dots with some text, using
Ngl.add_polymarker
and Ngl.add_text. Example traj1 shows how to draw polymarkers, again
using
Ngl.polymarker. Any one of these examples work for maps as well. You
just need to
use lat/lon coordinates to place the markers and the text on the map.

My suggestion is to use Ngl.add_polymarker and not Ngl.polymarker,
because when you
use the "add" version of the function, the markers are attached to the
plot. This means if
to resize the plot later, like to panel it, the markers will resize
automatically.

The code might look something like this:

...
mpres = Ngl.Resources()

mpres.nglFrame = False # Don't advance frame after plot is
created.
mpres.nglDraw = False # Don't draw plot just yet.

# Set up some other map resources to indicate which projection you
want, for one.
# mpres.mpProjection = "Orthographic"
map = Ngl.map(wks,mpres) # Create map.
# set up polymarker resources
gsres = Ngl.Resources()
gsres.gsMarkerColor = "red"
gsres.gsMarkerIndex = 16 # filled dot
# Attach two markers
mark1 = Ngl.add_polymarker(wks,map,[6.17,7.06], [34.79,34.17],gsres)
txres = Ngl.Resources()
txres.txFont = "helvetica-bold"
txres.txFontColor = "coral4"
txres.txFontHeightF = 0.037
txres.txJust = "TopCenter"
# Attach one text string
text1 = Ngl.add_text(wks,map,"location 1",6.17,34.79,txres)
Ngl.draw(map)
Ngl.frame(wks)
Ngl.end()

On Nov 4, 2008, at 5:24 AM, Yuval Itan wrote:

> Hello,
>
> I was wondering if it is possible to draw polymarkers as dots, and
> just next to them (say, above) their description. So if I have this
> data input:
> 34.78873333 6.166166667 Location1
> 37.16638333 7.0631 Location2
> then I will have two dots and next to them their "title".
>
> Also, is it possible to generate and place pie charts at specific
> locations on a map as polymarkers?
>
> Thank you,
>
> Yuval
>
> Discover the new Windows Vista Learn more!
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Tue Nov 04 2008 - 07:34:08 MST

This archive was generated by hypermail 2.2.0 : Fri Nov 14 2008 - 16:43:44 MST