Skip to content

DOC: add example aligning Cartopy and Matplotlib axes #2502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Feb 24, 2025

Rationale

Added a new gallery example adapted from #1498 (comment). I switched to using inset_axes as that reliably vertically aligns the two axes, which didn't always happen with the subplots approach. Also re-ordered the code a bit and reduced the number of projections. I have no strong opinion on how many and which projections to include, although I couldn't figure out how to get the right numbers of latitude lines for the Orthographic case without manually specifying them, and I'd rather not get into that kind of detail.

I'm not 100% sure which category this belongs under. For now it is under "gridlines and labels" because they are part of what we are lining up.

Implications

@rcomer
Copy link
Member Author

rcomer commented Feb 24, 2025

Renders like this

@greglucas
Copy link
Contributor

One thing that might be nice is to use the data from one of the scalar_data examples and plot what the zonal mean is of that actual function. Would it be worth adding a meridional mean below the axes as well, or would that add too much complexity with multiple to/from functions then?

@rcomer rcomer marked this pull request as draft February 26, 2025 11:25
@greglucas
Copy link
Contributor

@rcomer, I see you moved this to draft. Do you still want to add this in? I think we should add more helpful examples like this!

@rcomer
Copy link
Member Author

rcomer commented Apr 17, 2025

Thanks @greglucas yes, I had intended to follow up on your previous comment, but creative juices are not really flowing at the moment. I'm not sure when I'm going to get to it.

@greglucas
Copy link
Contributor

👍 Sounds good. I am personally happy with the way this is now, and don't think we need to get hung up on getting everything perfect / implemented right away. So I'd be fine merging this and then when your creativity strikes again updating this example or adding another one.

@rcomer rcomer marked this pull request as ready for review April 17, 2025 14:40
@greglucas greglucas merged commit 4566fbc into SciTools:main May 23, 2025
26 checks passed
@greglucas
Copy link
Contributor

Thanks @rcomer! We can follow up with further improvement as inspiration strikes, no rush here :)

@QuLogic QuLogic added this to the Next Release milestone May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants