Fill countries in python basemap

As has already been said by @unutbu, Thomas’ post here is exactly what you are after. Should you want to do this with Cartopy, the corresponding code (in v0.7) can be adapted from http://scitools.org.uk/cartopy/docs/latest/tutorials/using_the_shapereader.html slightly: import cartopy.crs as ccrs import matplotlib.pyplot as plt import cartopy.io.shapereader as shpreader import itertools import numpy as np shapename=”admin_0_countries” countries_shp … Read more

Plot only on continent in matplotlib

There’s method in matplotlib.basemap: is_land(xpt, ypt) It returns True if the given x,y point (in projection coordinates) is over land, False otherwise. The definition of land is based upon the GSHHS coastline polygons associated with the class instance. Points over lakes inside land regions are not counted as land points. For more information, see here.