'Plotting points on a map of the United States

I would like to obtain a map of the United States so I can plot coordinates or destination lines on it. I cannot seem to find how to plot a map of the US. Is there anyway I can do this in Python?



Solution 1:[1]

You can use pyplot's basemap module for things like that:

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

m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
            rsphere=(6378137.00,6356752.3142),\
            resolution='l',area_thresh=1000.,projection='lcc',\
            lat_1=50.,lon_0=-107.,ax=ax)

plt.show()

For more examples have a look at the basemap docu.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1