Here we cover even more of the many options to consider with basemap's mapping abilities. We still haven't even gotten to plotting yet! Don't worry, we will get there soon, I promise.
Here is some of the sample code from the video:
from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np def basicMap(): m = Basemap(projection='mill',llcrnrlat=-60,urcrnrlat=90,\ llcrnrlon=-180,urcrnrlon=180,resolution='c') m.drawcoastlines() m.drawcountries() m.drawstates() m.fillcontinents(color='#04BAE3',lake_color='#FFFFFF') m.drawmapboundary(fill_color='#FFFFFF') plt.title("Geo Plotting Tutorial") plt.show() basicMap() def coolerProjections(): m = Basemap(projection='mill',llcrnrlat=-60,urcrnrlat=90,\ llcrnrlon=-180,urcrnrlon=180,resolution='c') m.drawcountries() m.drawstates() m.bluemarble() plt.title("Geo Plotting Tutorial") plt.show() # are you getting an error like: # ImportError: The _imaging C module is not installed # This meanss you have PIL, but you have the wrong bit version. # If it says you don't have PIL at all, then you better go grab it # but this should have come with your matplotlib installation. coolerProjections()
The first function will generate a map similar-ish to the previous one we did, but the last function will give us something much more interesting looking.