我正在尝试使用轮廓在底图上创建填充轮廓线。这是我正在使用的代码。没有发生错误并且运行良好,甚至出现了颜色条,但没有显示轮廓,地图背景只有白色。如何使轮廓起作用?
x = [1,2,3]
y = [4,5,6]
z = [7,8,9]
x = np.array(x)
y = np.array(y)
z = np.array(z)
x = np.reshape(x, (1,-1))
y = np.reshape(y, (1,-1))
z = np.reshape(z, (1,-1))
cs = plt.contourf(x, y, z, 50, cmap='jet')
plt.colorbar()
map = Basemap(projection='cyl', resolution = 'l', area_thresh=1000.0,
llcrnrlon = -1, llcrnrlat = -1, urcrnrlon = 7, urcrnrlat = 7)
map.drawcoastlines()
map.drawcountries()
map.drawmapboundary()
map.drawmeridians(np.arange(0, 360, 30))
map.drawparallels(np.arange(-90, 90, 30))
for lon, lat in zip(x, y):
x, y = map(x, y)
map.plot(x, y, 'ro', markersize = 10)
plt.show()