You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Longitude label misplacement with custom lon0 (v2.7.2) #845
Longitude label misplacement with custom lon0 (v2.7.2)
When the prime meridian is shifted via lon0 in cylindrical projection, and the lonlim range wraps across 180°, longitude labels are not placed at the correct tick positions.
Thanks for looking into this.
The longitude labels for 120E and 160E are missing. I have tested other longitude ranges, and it works fine in most cases. This seems to be an intermittent label layout issue.
Thanks for the suggestion! I tried your workaround with uplt.rc.context({"grid.checkoverlap": False}). It successfully resolves the intermittent missing longitude labels problem. This workaround works perfectly.
Note that this is not a work around. We delegate to cartopy which makes space for the labels and hiding them when there is an overlap. Setting the rc value to override it will enforce that you use ultraplot formatting. See the docs for more information on setting rc values.
Activity
cvanelteren commentedon Oct 18, 2026
looks fine to me, whta am I missing?
xiaochen30 commentedon Oct 18, 2026
The longitude labels for 120E and 160E are missing. I have tested other longitude ranges, and it works fine in most cases. This seems to be an intermittent label layout issue.
cvanelteren commentedon Oct 18, 2026
I don't think this is an issue on our end but in cartopy's end.
cvanelteren commentedon Oct 18, 2026
Actually let me rephrase, not sure if it caused by us or cartpoy, but the issue can be resolved by rotating the labels or making the labels smaller
cvanelteren commentedon Oct 18, 2026
Yeah I checked, we delegate to cartopy.
You can circumvent this by bypassing this delgation
cvanelteren commentedon Oct 18, 2026
So you can either set this in rc or use local contexts.
xiaochen30 commentedon Oct 18, 2026
Thanks for the suggestion! I tried your workaround with
uplt.rc.context({"grid.checkoverlap": False}). It successfully resolves the intermittent missing longitude labels problem. This workaround works perfectly.cvanelteren commentedon Oct 18, 2026
Note that this is not a work around. We delegate to cartopy which makes space for the labels and hiding them when there is an overlap. Setting the rc value to override it will enforce that you use ultraplot formatting. See the docs for more information on setting rc values.
cvanelteren commentedon Oct 19, 2026
Added an annotation box in the docs for future reference.