- 积分
- 256
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2019-6-13
- 最后登录
- 1970-1-1
![[用户6047235790] 粉丝数:8 微博数:215 新浪微博达人勋](source/plugin/sina_login/img/light.png)
|
GrADS
系统平台: |
python |
问题截图: |
|
问题概况: |
请问如何将色标的上限取消掉 |
我看过提问的智慧: |
看过 |
自己思考时长(天): |
3 |
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我想实现下面这张图片的效果,我的代码是这样的,请各位大佬帮忙解惑clevs = [0., 0.1, 10., 25., 50., 100., 250.,500] # 自定义颜色列表cdict = ['#FFFFFF', '#A9F090', '#40B73F', '#63B7FF', '#0000FE', '#FF00FC',
'#850042'] # 自定义颜色列表 '#A9F090','#40B73F','#63B7FF','#0000FE','#FF00FC','#850042'
my_cmap = colors.ListedColormap(cdict) # 自定义颜色映射 color-map
norm = mpl.colors.BoundaryNorm(clevs, my_cmap.N) # 基于离散区间生成颜色映射索引
# 绘制等值线、等值线填色
cf = ax.contourf(olon, olat, rain_data_new, clevs, transform=ccrs.PlateCarree(), extend='max',cmap=my_cmap, norm=norm)
# ct = ax.contour(olon,olat,rain_data_new,clevs) # 绘制等值线
# clabel = ax.clabel(ct,fmt = '%i')
position = fig.add_axes([0.31, 0.15, 0.02, 0.2]) # 位置【左,下,宽。高】
cb = plt.colorbar(cf, cax=position) # 颜色参照表
plt.title('降水(mm)',fontsize=10)
position.set_yticklabels((0, 0.1, 10, 25, 50, 100, 250,500))
ax.xaxis.set_major_formatter(LongitudeFormatter(zero_direction_label=True))
ax.yaxis.set_major_formatter(LatitudeFormatter())
extent = [107.1, 109.8, 25.1, 27.7]
ax.set_extent(extent, crs=ccrs.PlateCarree())
ax.set_xticks(np.arange(107.1, 109.8, 0.5), crs=ccrs.PlateCarree()) # x轴
|
-
|