这是我的问题。在
现在可以用轮廓图库绘制地形图了。在
fig =plt.figure(figsize=(10,8))
ax = plt.subplot()
xi,yi = np.linspace(195.2260,391.2260,50), np.linspace(4108.9341,4304.9341,50)
height = np.array(list(csv.reader(open("terr_grd.csv","rb"),delimiter=','))).astype('float')
terrf = plt.contourf(xi, yi, height,15, cmap=plt.cm.Blues)
terr = plt.contour(xi, yi, height, 15,
colors='k',alpha=0.5)
plt.clabel(terr, fontsize=9, inline=1)
http://i13.tietuku.com/1d32bfe631e20eee.png
作为背景,可能会影响叠加图(不同颜色混合在一起)。在
我在下面上传的一本书上发现的这个图形是一种很好的视觉艺术。在
http://i11.tietuku.com/4d4178c16eb7aaf6.png
作为背景的地形根本不会影响叠加的流域(绿色)。在
所以,如何用matplotlib绘制这种类似的阴影地形,我尝试了一些彩色地图,但我不能得到一个相同的绘图。在
我已经用下面的代码尝试过alpha设置:
^{pr2}$如图所示:
http://i11.tietuku.com/5bb0b4cb0102ec32.png
不管我使用的数据是不同于流域的。我致力于描绘更真实的地形起伏,如我在这里发布的图2所示。在
您只需a)对齐两个绘图b)为绘图添加
alpha
关键字:相关问题 更多 >
编程相关推荐