我用python制作了一些彩色地图。我想在上面加上一些陆地模型。它只包含1或0,1代表土地,0代表没有土地。 等高线图上写着一些奇怪的字符。这里有人知道我如何让轮廓连接到它自己,这样它就平滑了,而不是在每一行的两端被那些奇怪的小字符打断?在
这是一段代码(注意这个地图是包含其他地图的绘图的一部分,所以这是索引9的地图)。在
lsmfile = netcdf.netcdf_file("/Volumes/LaCie/Plasim/Earth2/high/1367/SOL1367earth050.nc","r")
lat = lsmfile.variables["lat"].data
lon = lsmfile.variables["lon"].data
mask = lsmfile.variables["lsm"].data
mask = mask[0]
cmap = plt.get_cmap('bwr')
fig, ax = plt.subplots(nrows=5,ncols=2,figsize=(16,14))
im9 = ax.flat[9].pcolormesh(lon, lat, surfalbearth, cmap=cmap,norm=norm)
fig.colorbar(im9, ax=ax.flat[9])
ax.flat[9].set_xlim(xmin=0, xmax=355)
ax.flat[9].set_ylim(ymin=-86, ymax=86)
CS = plt.contour(lon,lat,mask, 1,colors='k')
plt.clabel(CS, fontsize=3, inline=1)
fig.tight_layout()
plt.savefig('Maps')
plt.show()
似乎你已经要求在你的曲线图中使用这些等高线标签(clabel)
因此,如果删除该线,等高线标签将消失。在
相关问题 更多 >
编程相关推荐