问题遇到的现象和发生背景
之前做工作一个项目时,没有单独设置本项目的interpreter,好多项目混乱使用一个。最近工作清闲,打算重新为这个项目建立一个interpreter,库都按照之前写的requirements重新安装的。结果就在matplotlib.pyplot.axes(projection=ccrs.PlateCarree()).set_extent()出问题了,总是报错。
问题相关代码,请勿粘贴截图
Python 3.7.6 (default, Jan 8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] on win32
import numpy as np
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
from shapely.geometry import Polygon
import os
import pandas as pd
Backend TkAgg is interactive backend. Turning interactive mode on.
fig = plt.figure(figsize=[16, 14])
ax = fig.add_subplot(projection=ccrs.PlateCarree())
ax.set_extent([100,120,25,40],crs=ccrs.PlateCarree())
Process finished with exit code -1073741819 (0xC0000005)
运行结果及报错内容
Process finished with exit code -1073741819 (0xC0000005)
我的解答思路和尝试过的方法
之前我以为是matplotlib版本有问题,试过好几个版本,都不行
我想要达到的结果
运行成功