| 
 
	积分1890贡献 精华在线时间 小时注册时间2018-2-27最后登录1970-1-1 
 | 
 
| 
本帖最后由 sam_doggy 于 2019-6-3 12:27 编辑
x
登录后查看更多精彩内容~您需要 登录 才可以下载或查看,没有帐号?立即注册 
  
 复制代码
# ===================================================
# ===================================================
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
import cartopy.feature as cfeature
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
scale = '110m'
fig = plt.figure(figsize=(8, 10))
ax = plt.axes(projection=ccrs.PlateCarree(central_longitude=180))
ax.set_global()
# ===================================================
land = cfeature.NaturalEarthFeature('physical', 'land', scale, edgecolor='face',
                                    facecolor=cfeature.COLORS['land'])
ax.add_feature(land, facecolor='0.75')
# ===================================================
ax.coastlines(scale)
# ===================================================
ax.set_xticks([0, 60, 120, 180, 240, 300, 360], crs=ccrs.PlateCarree())
ax.set_yticks([-90, -60, -30, 0, 30, 60, 90], crs=ccrs.PlateCarree())
lon_formatter = LongitudeFormatter(zero_direction_label=False)
lat_formatter = LatitudeFormatter()
ax.xaxis.set_major_formatter(lon_formatter)
ax.yaxis.set_major_formatter(lat_formatter)
gl = ax.gridlines()
之前一直用basemap,刚准备转用cartoapy
 
 我copy了@阿阿飞飞在 http://bbs.06climate.com/forum.p ... 3601&extra=page%3D1 中的代码,然而右端的0度没显示,进去看了geoaxes的源码,但是没找到问题....
 
 刚刚进官网看示例也是没有右边的tick啊
 
 
 有替代的解决方法如下:
 https://stackoverflow.com/questi ... ertab=votes#tab-top
 
 
 复制代码[0, 60, 120, 180, 240, 300, 359.9999999999]
 为什么阿飞的帖子里是ok 的我就不懂了
 
 
 
 
 | 
 
  
  |