Skip to content

[Feature] Abc anchor and Geo aspect#767

Open
cvanelteren wants to merge 1 commit into
Ultraplot:mainfrom
cvanelteren:feature/abc-anchor-mode-and-geo-aspect
Open

[Feature] Abc anchor and Geo aspect#767
cvanelteren wants to merge 1 commit into
Ultraplot:mainfrom
cvanelteren:feature/abc-anchor-mode-and-geo-aspect

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

Mixed plots with GeoAxes and normal cartesian plots are a bit cumbersome to deal with. The major issue is that cartopy will adjust the subplot dimension such that it matches the aspect ratio of the plot. This makes the subplot look good, but runs into issues when we have multiple subplot kinds within one figure. This PR will introduce 2 new options.

With abcanchor users can now override the default behavior of putting the abc in the top left corner, by stating the alignment point. For example, setting abcanchor="slot" will set the anchor mode to be within the "slot" of the layout rather than the axes as a reference point.

image

In addition, aspect can now be set on geo axes (i.e. aspect = "auto"); this aids in forcing aspect to match the rest of the plot rather than the reshaping performed by cartopy.

I think these features together will give users within geoscience more power and flexibility.

snippet
import ultraplot as uplt

layout = [[1, 2], [3, 4]]
fig, axs = uplt.subplots(
    layout,
    proj={4: "cyl"},
    share=False,
)
axs.format(abc = True)
axs.format(land = True, landcolor = "k", oceancolor = 'ocean blue', ocean = True, abcanchor = "slot")

@cvanelteren cvanelteren marked this pull request as ready for review July 15, 2026 08:16
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.14286% with 16 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/axes/geo.py 56.75% 10 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@cvanelteren cvanelteren requested a review from gepcel July 15, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant