Skip to content

Instantly share code, notes, and snippets.

@alexrutherford
Last active September 22, 2015 00:30
Show Gist options
  • Save alexrutherford/cd32fa99e5f2f306f5da to your computer and use it in GitHub Desktop.
Save alexrutherford/cd32fa99e5f2f306f5da to your computer and use it in GitHub Desktop.
Example plot of globe using basemap
from mpl_toolkits.basemap import Basemap
m = Basemap(projection='merc',lon_0=0,lat_0=0,resolution='l',area_thresh=30000,llcrnrlon=-120,llcrnrlat=-60,urcrnrlon=170,urcrnrlat=70)
m.drawcountries(linewidth=0.25,color='white')
m.drawlsmask(lakes=False)
for coord in random.sample(coords,10000):
# We select 10k checkins at random as too many checkins
m.plot(coord[1],coord[0],marker='o',color='r',markersize=1,latlon=True,alpha=0.1)
plt.savefig('map.png',dpi=200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment