import numpy as np
import shapefile
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
sf = shapefile.Reader('D:\\ne_10m_land.shp')
lons, lats = [], []
for shape in sf.shapes():
parts = shape.parts
parts.append(len(shape.points))
lons.append([])
lats.append([])
for pi, pf in zip(parts[:-1],parts[1:]):
points = np.array(shape.points[pi:pf])
lons[-1].append(points[:,0])
lats[-1].append(points[:,1])
m = Basemap(llcrnrlon=0, urcrnrlon=360, llcrnrlat=-90, urcrnrlat=90)
for lon, lat in zip(lons, lats):
for lo, la in zip(lon, lat):
m.plot(lo, la, linewidth=0.4, color='k')
plt.show()
plt.close()