我需要制作一个包含 n 个底图子图的图。但是当我这样做时,所有值都绘制在第一个子图上。
我的数据是一组“n”矩阵,存储在data_all
.
f, map = plt.subplots(n,sharex=True, sharey=True, figsize=(20,17))
plt.subplots_adjust(left=None, bottom=None, right=None, top=None,
wspace=None, hspace=0.)
for i in range(n):
map = Basemap(projection='merc', lat_0=0, lon_0=180,
resolution='h', area_thresh=0.1,
llcrnrlon=0, llcrnrlat=-45,
urcrnrlon=360, urcrnrlat=45)
map.drawcoastlines(linewidth=0.5)
map.drawmapboundary()
map.drawmapboundary()
nx = data_all.shape[0]
ny = data_all.shape[1]
lon, lat = map.makegrid(ny[i], nx[i])
z,y = map(lon, lat)
cs = map.contourf(z, y, data_all[i])