Basemap scatter plot, set color according to value

Hi,

I want to show some points on a world map. But the color of a point is linked to the value at the point. Any idea why the code below does not give what I want (same color, no legend)?

Many thanks,

Tom

from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
import numpy as np

lats = [47.8, -54.85, 47.0544, 44.18, 47.42, 46.55]
lons = [11.02, -68.32, 12.9583, 10.7, 10.98, 7.99]
scores = [4.93657698397, -31.0626756529, 35.2049971001, 23.1060270438, 12.5139213403, 17.3946319493]

map = Basemap(projection = ‘mill’)
map.drawcoastlines()
map.drawmapboundary()

for lat, lon, score in zip(lats, lons, scores):
print(‘Score at (%f, %f) is %f’ % (lat, lon, score))
x, y = map(lon, lat) # Notice x = lon, y = lat
map.scatter(x, y, marker = ‘o’,
s = 500,
c = score,
cmap = plt.get_cmap(‘rainbow’))

plt.legend()
plt.show()