import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.basemap import Basemap
m = Basemap() # 实例化一个map
m.drawcoastlines() # 画海岸线
m.drawmapboundary(fill_color='white')
m.fillcontinents(color='white',lake_color='white') # 画大洲,颜色填充为白色
parallels = np.arange(-90., 90., 10.) # 这两行画纬度,范围为[-90,90]间隔为10
m.drawparallels(parallels,labels=[False, True, True, False])
meridians = np.arange(-180., 180., 20.) # 这两行画经度,范围为[-180,180]间隔为10
m.drawmeridians(meridians,labels=[True, False, False, True])
plt.show()
结果: