cartopy 绘图错误 AttributeError: ‘GeoAxesSubplot‘ object has no attribute ‘_autoscaleXon‘

在运行下列代码时,突然就出错了

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 就可以运行了,

以后要管理号自己的环境,不然一不小心就挂掉了哈哈哈

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值