Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is plotting an image on a map with matplotlib possible?

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.

like image 827
kari.patila Avatar asked Feb 05 '09 17:02

kari.patila


2 Answers

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/

like image 65
joeforker Avatar answered Nov 11 '22 13:11

joeforker


For your reference, I answered a similar question to this the other day: Python Matplotlib Basemap overlay small image on map plot

like image 30
pelson Avatar answered Nov 11 '22 13:11

pelson