在运行下列代码时,突然就出错了
import matplotlib.pyplot as plt###引入库包
import cartopy.crs as ccrs
proj = ccrs.PlateCarree()
fig = plt.figure(figsize=(4, 4), dpi=200) # 创建画布
ax = plt.axes(projection=ccrs.PlateCarree())# 创建子图
ax.coastlines()# 调用ax的方法画海岸线
AttributeError: 'GeoAxesSubplot' object has no attribute '_autoscaleXon'
参考以下两篇文章(20条消息) Python报错:AttributeError: ‘AxesSubplot‘ object has no attribute ‘bar_label‘_拔牙不打麻药的博客-CSDN博客(20条消息) AttributeError: 'GeoAxesSubplot' object has no attribute '_autoscaleXon-编程语言-CSDN问答
以为是matplotlib 库得版本太低,但是我发现已经是最新版本3.6了
于是我就把 matplotlib 降到 3.5 就可以运行了,
以后要管理号自己的环境,不然一不小心就挂掉了哈哈哈