我在https://mapbox.github.io/rasterio/topics/plotting.html学习这个例子
正在使用这个geotiff文件http://download.osgeo.org/geotiff/samples/spot/chicago/SP27GTIF.TIF
这是我的代码:
import rasterio
from matplotlib import pyplot
tif_file = "SP27GTIF.TIF"
src = rasterio.open(tif_file)
pyplot.imshow(src.read(1), cmap='pink')
pyplot.show = lambda : None # prevents showing during doctests
pyplot.show()我运行代码,没有任何错误,但我也没有看到任何阴谋。有什么想法吗?
发布于 2017-06-14 07:06:50
行pyplot.show = lambda : None为pyplot.show分配一个lambda函数。从那时起,当调用pyplot.show()时,显示一个图的通常方式被这个无意义的lambda函数所取代。
删除这一行将使您的情节看起来像往常一样。
https://stackoverflow.com/questions/44534009
复制相似问题