我正在按照 Cartopy 官方网站中提供的示例尝试使用 Cartopy。它们都正常工作,但第一个
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
ax = plt.axes(projection=ccrs.PlateCarree())
ax.coastlines()
plt.show()
所有行都正常工作,但是一旦我运行 plt.show() 命令,我就会收到以下错误消息:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1539, in __call__
return self.func(*args)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 278, in resize
self.show()
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 349, in draw
FigureCanvasAgg.draw(self)
File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_agg.py", line 469, in draw
self.figure.draw(self.renderer)
File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1079, in draw
func(*args)
File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/mrvaita/python_workspace/gis_venv/local/lib/python2.7/site-packages/cartopy/mpl/geoaxes.py", line 359, in draw
inframe=inframe)
File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 2092, in draw
a.draw(renderer)
File "/usr/lib/python2.7/dist-packages/matplotlib/artist.py", line 59, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "/home/mrvaita/python_workspace/gis_venv/local/lib/python2.7/site-packages/cartopy/mpl/feature_artist.py", line 113, in draw
{})
File "/usr/lib/python2.7/weakref.py", line 433, in setdefault
return self.data.setdefault(ref(key, self._remove),default)
TypeError: unhashable type: 'MultiLineString'
有人已经对此有所了解吗?我的 matplotlib 版本是 1.4.2,Cartopy 版本是 0.13.0
非常感谢您的帮助。