Skip to content
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

Turn GeoAxes.outline_patch into a GeoSpine. #1213

Merged
merged 1 commit into from Nov 27, 2018

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Nov 20, 2018

Rationale

This patch deprecates GeoAxes.outline_patch as well, since the spine machinery works fine for what we want to do. The dictionary key is 'geo' to match the one used by the Matplotlib GeoAxes.

The GeoSpine is a minimal implementation to have it work as it did before, but more things may be implemented in the future if necessary.

Since PathPatch has default line width of 1.0, and spines have default line width of 0.8, some boundary lines have changed slightly in the test images.

Implications

Fixes #1077.
Fixes #829.
First step towards fixing up #1207.

@QuLogic
Copy link
Member Author

QuLogic commented Nov 24, 2018

Small amendment; I decided to override the two public methods of Spine we needed, instead of just the private method, as I wanted to avoid another _hold situation.

This patch deprecates GeoAxes.outline_patch as well, since the spine
machinery works fine for what we want to do. The dictionary key is 'geo'
to match the one used by the Matplotlib GeoAxes.

The GeoSpine is a minimal implementation to have it work as it did
before, but more things may be implemented in the future if necessary.

Since PathPatch has default line width of 1.0, and spines have default
line width of 0.8, some boundary lines have changed slightly in the
test images.

"""
axes = event.axes
# trigger the outline and background patches to be re-clipped
axes.outline_patch.reclip = True
axes.spines['geo'].stale = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring only talks about forcing the background patch to be reclipped. Do we really need to set stale here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originally, no matter which had reclip=True, both would be updated. Setting stale now is equivalent to setting what reclip did except each thing happens independently.

It doesn't seem like this is necessary now (at least from tests) and I don't remember exactly why I left it, but I believe this will be necessary when backgroud_patch is removed. I will try again when I get to working on that once more.

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.

Cannot change the border width of the cartopy axes frameon=False does not remove map frame
2 participants