【发布时间】:2020-10-14 20:41:22
【问题描述】:
最近我在 python 3.8 上更新到 matplotlib 3.3.1。我使用 cartopy 0.18.0 版。在这个版本中,背景图像插值似乎不再起作用。有没有人有解决方法/解决方案? 这是一个最小的可重现示例:
import matplotlib.pyplot as plt
import cartopy as ccrs
import cartopy.io.img_tiles as cimgt
fig, ax = plt.subplots(subplot_kw=dict(projection=ccrs.crs.PlateCarree()))
ax.set_extent([67, 75, 20, 26])
ax.add_image(cimgt.GoogleTiles(), 8, interpolation='spline36')
这会引发错误:
TypeError:得到了一个意外的关键字参数“插值”
【问题讨论】:
-
你想要的结果是什么?
cartopy的哪个版本支持cartopy.mpl.geoaxes.GeoAxes.add_image的“插值”参数?add_image当前不允许任何 args 或 kwargs github.com/SciTools/cartopy/blob/… -
我使用相同版本的 cartopy,但在 python 3.6 上使用 matplotlib 3.1。我需要插值以获得更好看的地图。例如,请参阅stackoverflow.com/questions/49155110/…
标签: python matplotlib cartopy