views:

536

answers:

2

Using basemap it's easy to plot a set of coordinates, like so:

x, y = m(lons, lats)    
m.plot(x, y, 'go')

but would it be possible to use an image instead of the green circle ('go')? I didn't find a direct way of doing this from the documentation.

So, let's clarify this a bit: I'm using a map generated with basemap as a background and would like to plot some .png images on top of it instead of the regular plain markers.

+3  A: 

If you want to draw .png images then you should try http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow

You might also be interested in the Matplotlib Basemap toolkit. http://matplotlib.sourceforge.net/basemap/doc/html/

joeforker
I'm trying to use a .png image instead of a plain marker, and yes, I'm doing this on a Basemap-generated map.
kari.patila
Let us know if matplotlib.pyplot.imshow works for you.
joeforker
A: 

I tried to use imshow to add an image... I works fine and using set_extent method, it is possible to place precisely the image on the map.

However... the image is always displayed as a background.

Then if we use mpl_toolkits.basemap.contourf to plot the topography for example, then the image completely disapear, covered by the upper layers (topo/coastlines/etc).

Some ideas?

zac