-
Notifications
You must be signed in to change notification settings - Fork 12
GeoTicks not responsive #253
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
Conversation
97473bb
to
d483c1d
Compare
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
Looks good. The failure of the test is expected given the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors how geographic tick labels are toggled and shared across subplots and backends, and updates tests to match the new API.
- Renames gridliner label toggles to
label{side}
and adds_is_ticklabel_on
helpers. - Introduces
_share_labels_with_others
inFigure
to centralize label sharing logic. - Updates and adds tests (
test_tick_toggler
,test_sharing_cartopy_with_colorbar
) to cover the new behavior.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
ultraplot/tests/test_geographic.py | Adjusted tests for new label{side} API, added tick toggler and colorbar sharing tests |
ultraplot/figure.py | Added _share_labels_with_others and integrated it into format flow |
ultraplot/axes/geo.py | Refactored _toggle_gridliner_labels , added _is_ticklabel_on , updated gridline updates |
ultraplot/axes/base.py | Added _is_ticklabel_on for non-geographic axes |
Comments suppressed due to low confidence (4)
ultraplot/axes/geo.py:1750
- The ordering of sides here differs from the later zip in
update_major_gridlines
(which useslabelleft labelright labeltop labelbottom geo
), potentially causing mismatched label toggles.
for side, lon, lat in zip("labelleft labelright labelbottom labeltop geo".split(), lonarray, latarray):
ultraplot/axes/geo.py:2199
- Inconsistent side ordering compared to earlier implementation may lead to incorrect behavior—align the side lists.
for side, lonon, laton in zip("labelleft labelright labeltop labelbottom geo".split(), lonarray, latarray):
ultraplot/axes/base.py:3202
- [nitpick] Docstring could clarify which Matplotlib attributes (
label1
vslabel2
) map to which sides and what each represents.
def _is_ticklabel_on(self, side: str) -> bool:
ultraplot/figure.py:1317
- Debug
print
left in_share_labels_with_others
should be removed or replaced with a logger call to avoid console noise.
print(axi.number)
Co-authored-by: Matthew R. Becker <[email protected]>
testing error is expected and new plot looks better |
Addresses #252