我在matplotlib图中使用Stamen瓦片绘制地图,如下所示:
tiler=Stamen('terrain-background')
mercator=tiler.crs
ax3=fig.add_subplot(gs01[1,0], projection=ccrs.PlateCarree())
ax3.add_image(tiler,14)然后我尝试旋转网格线记号标签,如下所示:
gl3=ax3.gridlines(crs=ccrs.PlateCarree(), draw_labels=True, linewidth=1., color='gray', alpha=0.75, linestyle='--')
gl3.left_labels=False
gl3.top_labels=False
gl3.xlabel_style={'size':10., 'color':'gray', 'weight':'bold'}
gl3.ylabel_style={'size':10., 'color':'gray', 'weight':'bold'}
gl3.rotate_labels=45不幸的是,当我打开保存在脚本中的PNG文件时,没有任何东西被旋转。有没有其他方法可以旋转网格线记号标签?
发布于 2020-07-16 22:06:26
好的,我在车身问题追踪器上找到了答案。
您可以通过设置来更改旋转角度
gl3.xlabel_style = {'rotation': 45}
gl3.ylabel_style = {'rotation': 45}https://stackoverflow.com/questions/62904409
复制相似问题