Closed pletzer closed 1 year ago
I'm sorry we didn't see this sooner.
It looks like you might need this helper function to deal with the cyclic coordinates: https://geocat-viz.readthedocs.io/en/latest/user_api/generated/geocat.viz.util.xr_add_cyclic_longitudes.html
There's also an example here that might help: https://geocat-examples.readthedocs.io/en/latest/gallery/Contours/NCL_conLev_4.html#sphx-glr-gallery-contours-ncl-conlev-4-py
Let us know if you're still having trouble or I misunderstood what you're looking to do.
I'm going to close this for now, but if you're still having trouble with this feel free to reopen.
Describe the bug
I'm struggling with plotting a field over a sub-region that straddles the data line (longitude = 180 deg). The problem, which seems to be related to calling ax.set_extent([xlim[0], xlim[1], ylim[0], ylim[1]], proj), shows up as only the west side of the plot being displayed. The original field is defined for longitudes = 0, ... 360.
To Reproduce
Run the following code to reproduce the problem:
Expected behavior The above code produces two plots using different xlim values. In both cases the displayed domain is wrong. For the first plot, xlim = (150, 200) no data are shown from 180W to 160W. For the second plot, the field is displayed from 160W to 150E. See below.
Screenshots
Environment (please complete the following information):
Additional context