from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt #setup the projection m = Basemap(projection='merc',llcrnrlat=20,urcrnrlat=50,\ llcrnrlon=-130,urcrnrlon=-60,lat_ts=20,resolution='i') #create some points to plot #provided is a csv file with the lat/long of US states import pandas as pd from pandas import DataFrame data=pd.read_csv('DataFiles\usa_lat_long.csv') #it has some duplicates data.head() #I just want the lat/long in a list points=data[['longitude','latitude']].values #transform the points into map coordinates transform_points=[m(lng, lat) for lng, lat in points] #do all the drawing: fig=figure(figsize=(10,10)) #make a larger than default image fig.add_subplot(1,1,1) #not strictly required m.drawmapboundary(fill_color='white') m.fillcontinents(color='white',lake_color='white') m.drawcoastlines(color='black', linewidth=.3) m.drawcountries(color='black', linewidth=.3) m.drawstates(color='black', linewidth=.3) #plot the points on the map. These are just regular calls to matplotlib with x,y data #you could also do this in one shot by using plot(xlist, ylist...) #or using scatter(). for x,y in transform_points: plot(x,y,'o',color='red',ms=10*rand()) #plot them at random sizes #we can plot some labels text(transform_points[7][0],transform_points[7][1],'California',fontsize=15) text(transform_points[12][0],transform_points[12][1],'Florida',fontsize=15) #draw some great circles lng1,lat1 =points[12] lng2,lat2 =points[7] m.drawgreatcircle(lng1,lat1,lng2,lat2,linewidth=3,color='blue',alpha=.5)