I'm using matplotlib's basemap functionality to plot data points on a map. Each point is weighed by how many co-occurring points exist within a 5-kM radius. I'd like to put a reference table that corresponds to different-sized outbreaks at the bottom, however I can't figure out how to do this. This is my code so far:
map = Basemap(llcrnrlon=-20.,llcrnrlat=-40,urcrnrlon=160.,urcrnrlat=40.,projection='cyl', lat_0=13.5317, lon_0=2.4604)
map.drawmapboundary(fill_color='paleturquoise')
map.fillcontinents(color='olivedrab',lake_color='paleturquoise')
map.drawcoastlines()
map.drawcountries()
map.drawstates()
used = set()
for i,j,k,n in DATA:
if map.is_land(i,j):
if k in used: continue
used.add(k)
alpha = 0.5
if n == 1:
alpha = 1
n *= 3
map.plot(i, j, marker='o',color='r',ms=n, alpha=alpha)
plt.show()
note, DATA is a list of 4-tuples. Each entry in the 4-tuple corresponds to the (latitude, longitude, unique ID corresponding to points co-occuring within a 5x5 km square, number of points with the same uniq ID)
result: