Basemap - coastlines overlay question

The code at the end of this message is a toy example which shows the problem I am encountering.
OS X 10.4.9 basemap 0.9.5 (Numeric 24.2 and Numpy 1.0) python 2.5

I define a map projection using Basemap, and then plot a number of markers at various geographical locations.
I would like the map coastlines to overlay the marker symbols, that is write over them as they pass through them.
I cannot get the coastlines to overlay the markers, no matter what the calling sequence. The markers always obscure the coastlines.

In the basemap/example contour_demo.py, the coastlines are called after contourf and the coastlines appear over the filled contours.
So there seems that there is something different in the plot marker characteristics.

I am probably missing something obvious - but what?

--Jim

import pylab
from matplotlib.toolkits.basemap import Basemap
rawindLocations =[(-12.425,130.891),(-11.3081,131.7651),(-12.5858,131.7609),(-11.40891,130.41669),(-13.2287,131.1355),(-12.4,129.8)]
keyLat = -12.425
keyLon = 130.891
fig = pylab.figure(figsize = (7,10) )
ax = fig.add_axes([0.1,0.1,0.7,0.7])
m = Basemap(llcrnrlon=keyLon-5.0,llcrnrlat=keyLat-5.0,urcrnrlon=keyLon+5.0,urcrnrlat=keyLat+5.0,resolution='i',projection='merc',lon_0=130,lat_ts=0.,lat_0=-12.5)
xmap,ymap = m([keyLon],[keyLat])
pts = m.plot(xmap, ymap,'gs')
for p in rawindLocations:
     xmap,ymap = m(p[1],p[0])
     pts = m.plot([xmap], [ymap],'rs',markersize=24)

xmap,ymap = m([keyLon],[keyLat])
pts = m.plot(xmap, ymap,'ch',markersize=36)
m.drawcoastlines()
m.drawcountries()
title = 'example'
ax.set_title(title)
fig.savefig('crap')
fig.clf()

James Boyle wrote:

The code at the end of this message is a toy example which shows the problem I am encountering.
OS X 10.4.9 basemap 0.9.5 (Numeric 24.2 and Numpy 1.0) python 2.5

I define a map projection using Basemap, and then plot a number of markers at various geographical locations.
I would like the map coastlines to overlay the marker symbols, that is write over them as they pass through them.
I cannot get the coastlines to overlay the markers, no matter what the calling sequence. The markers always obscure the coastlines.

In the basemap/example contour_demo.py, the coastlines are called after contourf and the coastlines appear over the filled contours.
So there seems that there is something different in the plot marker characteristics.

I am probably missing something obvious - but what?

--Jim

Jim: Using 'zorder=0' when calling the Basemap plot method seems to do the trick. Perhaps I should add a 'zorder' keyword to drawcoastlines as well (there already is one for fillcontinents).

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory