同时,matplotlib库默认给圆图打标签的方式并不友好,位于中轴的标签往往不是水平放置的。在网上找了很久也没找到在圆图调整标签角度的代码,于是我想了一个比较复杂的处理方法,供大家参考:
g1=fig_ax1.gridlines(crs=ccrs.PlateCarree(),draw_labels=True,
color='none')
g1.xlocator = mticker.FixedLocator([-120,-60,60,120])
g1.ylocator = mticker.FixedLocator([0])
g1.xlabel_style = {'size': 16, 'color': 'black'}
g1.ylabel_style = {'size': 0, 'color': 'black'}
g2=fig_ax1.gridlines(crs=ccrs.PlateCarree(),draw_labels=True,
color='none')
g2.xlocator = mticker.FixedLocator([0])
g2.ylocator = mticker.FixedLocator([0])
g2.xlabel_style = {'size': 16, 'color': 'black','rotation':0,
'va':'top', 'ha':'center'}
g2.ylabel_style = {'size': 0, 'color': 'black'}
g3=fig_ax1.gridlines(crs=ccrs.PlateCarree(),draw_labels=True,
color='none')
g3.xlocator = mticker.FixedLocator([180])
g3.ylocator = mticker.FixedLocator([0])
g3.xlabel_style = {'size': 16, 'color': 'black','rotation':0,
'va':'bottom', 'ha':'center'}
g2.ylabel_style = {'size': 0, 'color': 'black'}