| 
 
	积分713贡献 精华在线时间 小时注册时间2020-2-17最后登录1970-1-1 
 | 
 
 发表于 2021-5-14 12:56:14
|
显示全部楼层 
| 请问为什么所有的地方都被覆盖掉了 还有错误/home/jareau/miniconda3/envs/123/lib/python3.7/site-packages/cartopy/mpl/geoaxes.py:782: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.
 return super(GeoAxes, self).set_xticks(xticks, minor)/home/jareau/miniconda3/envs/123/lib/python3.7/site-packages/cartopy/mpl/geoaxes.py:829: MatplotlibDeprecationWarning: Passing the minor parameter of set_ticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later.  return super(GeoAxes, self).set_yticks(yticks, minor)
 
 
 Out[3]: <matplotlib.colorbar.Colorbar at 0x7fc74c125b50>
 
 
 /home/jareau/miniconda3/envs/123/lib/python3.7/site-packages/cartopy/mpl/geoaxes.py:388: MatplotlibDeprecationWarning: The 'inframe' parameter of draw() was deprecated in Matplotlib 3.3 and will be removed two minor releases later. Use Axes.redraw_in_frame() instead. If any parameter follows 'inframe', they should be passed as keyword, not positionally.  inframe=inframe)
 
 
 复制代码from scipy.interpolate import  Rbf
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
import cartopy.mpl.ticker as cticker
import cartopy.io.shapereader as shpreader
import maskout
fig_2=plt.figure(figsize=(15,10))
proj = ccrs.PlateCarree(central_longitude=115) 
leftlon,rightlon,lowerlat,upperlat=(70,137.5,15,52.5)
lon_formatter = cticker.LongitudeFormatter(zero_direction_label=False)
lat_formatter = cticker.LatitudeFormatter()
f= fig_2.add_axes([0.1,0.1,0.9,0.9],projection = proj)
f.xaxis.set_major_formatter(lon_formatter)
f.yaxis.set_major_formatter(lat_formatter)
f.set_extent([leftlon, rightlon, lowerlat, upperlat], crs=ccrs.PlateCarree())
f.add_feature(cfeature.COASTLINE.with_scale('50m'))
f.add_feature(cfeature.LAKES, alpha=0.5)
f.set_xticks(np.arange(leftlon,rightlon+5,5), crs=ccrs.PlateCarree())
f.set_yticks(np.arange(lowerlat,upperlat+5,5), crs=ccrs.PlateCarree())
china = shpreader.Reader('country1.dbf').geometries()
f.add_geometries(china,ccrs.PlateCarree(),facecolor='none', edgecolor='black',zorder = 1)
f.set_title('EU&tem',loc='left',fontsize =20)
c2=f.contourf(slon,slat,r2_new[:],levels=np.arange(-1,1.1,0.1), zorder=0,cmap=plt.cm.coolwarm,transform=ccrs.PlateCarree())
c2_=f.contourf(slon,slat,p2_new,[np.min(p2_new),0.05,np.max(p2_new)],zorder=1,hatches=['.',None],colors="none",transform=ccrs.PlateCarree())
clip=maskout.shp2clip(c2,f,'country1','China')
cbposition=fig_2.add_axes([0.1,0.05,0.9,0.07])
fig_2.colorbar(c2,cax=cbposition,orientation='horizontal',format='%.1f')
 | 
 |