我想尝试一些Cartopy 画廊示例。我现在正在尝试非洲地图,但是当我运行时:
import cartopy
import matplotlib.pyplot as plt
ax = plt.axes(projection=cartopy.crs.PlateCarree())
我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 641, in axes
if len(args)==0: return subplot(111, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 766, in subplot
a = fig.add_subplot(*args, **kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/figure.py", line 772, in add_subplot
projection_class = get_projection_class(projection)
File "/usr/lib/pymodules/python2.7/matplotlib/projections/__init__.py", line 61, in get_projection_class
raise ValueError("Unknown projection '%s'" % projection)
ValueError: Unknown projection '<cartopy.crs.PlateCarree object at 0x41af230>'
我无法使这些预测中的任何一个起作用......我认为我拥有所有依赖项并且无法弄清楚导致此错误的原因。有任何想法吗?