How to set curvilinear lat lon gridline labels parallel to gridlines with cartopy?

空扰寡人 提交于 2021-01-29 09:40:55

问题


Description
Is there a method available (or under consideration) to orient the lat lon gridline labels parallel to the gridlines as they intersect the plot boundary? Something like the labels seen in this plot. There seems to be an automated logic in place for orienting gridline labels as follows:

Cartopy version
0.18.0b1

Code

import matplotlib.pyplot as plt
import cartopy.crs as ccrs

rotated_crs = ccrs.RotatedPole(pole_longitude=120.0, pole_latitude=70.0)

ax = plt.axes(projection=rotated_crs)
ax.set_extent((-6, 3, 48, 58), crs=ccrs.PlateCarree())
ax.coastlines(resolution='50m')

gl = ax.gridlines(draw_labels=True,x_inline=False, y_inline=False)
plt.show()

Result
See resulting plot here.

Notice the inconsistent orientation of gridline labels, which can get somewhat messy. It is possible to disable the automated orientation feature with gl.rotate_labels = False, however, I can't seem to find a method to align the label angle so that the text is parallel to the gridline as it intersects the plot boundary. See plot linked under the description.

Additional Information
I think this issue was discussed here, but doesn't seem to have been addressed further.

来源:https://stackoverflow.com/questions/61786344/how-to-set-curvilinear-lat-lon-gridline-labels-parallel-to-gridlines-with-cartop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!