带轮廓线和水平的错误地图图

时间:2020-09-20 17:11:40

标签: python matplotlib matplotlib-basemap contourf

我正在尝试制作具有明确级别的轮廓图。我正在使用12色色图。 但是,从第4级开始,contourf的行为似乎很奇怪。它还省略了2种颜色! 可以看到我做错了什么吗?

随后是python脚本的相对部分,我也附上了图片

fig = plt.figure()
map=Basemap(projection='stere',llcrnrlon=Lon_min,llcrnrlat=Lat_min,urcrnrlon=Lon_max,urcrnrlat=Lat_max,resolution='i',area_thresh=10., epsg = 4326) 
map.drawcoastlines(linewidth=0.8, color='black')
map.drawcountries(linewidth=0.6, color='black')
map.drawlsmask(land_color='lightgray', ocean_color='white', resolution='f', grid=1.25)
mylevels=[0.5, 2, 4, 10, 20, 40, 60, 70, 90, 100, 120]
cs_CRR = map.contourf(x,y,CRR_tot, cmap='Paired', levels=mylevels, extend="both")
cb = map.colorbar(location="bottom")
cb.set_ticks(mylevels)
cb.set_ticklabels(mylevels)
cb.set_label('Precipitation (mm)', size=10)

在Python中用Contourf映射:

0 个答案:

没有答案