Here, we will focus on adding a “zoom box” on the top left corner of the plot. But before that, we will mask a part of the earthquakes, in order to have a “cleaner” map ! This is achieved by…
Month: May 2010
Matplotlib Basemap tutorial 02 : Let’s add some earthquakes !
Now, let’s imagine we have a dataset containing latitude/longitudes of earthquakes, plus their depth and magnitude. Of course, you don’t always have this dataset available, so let’s build a fake one : import numpy as np lon = np.random.random_integers(11,79,1000)/10. lat…
Matplotlib Basemap tutorial 01 : Your first map
# # BaseMap example by geophysique.be # tutorial 01 from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np fig = plt.figure(figsize=(11.7,8.3)) #Custom adjust of the subplots plt.subplots_adjust(left=0.05,right=0.95,top=0.90,bottom=0.05,wspace=0.15,hspace=0.05) ax = plt.subplot(111) #Let’s create a basemap around Belgium m…