Skip to content

feat: advanced axis sharing refactor + enhancements #256

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

Open
wants to merge 77 commits into
base: main
Choose a base branch
from

Conversation

cvanelteren
Copy link
Contributor

Rename of #244

One of UltraPlot's most powerful features is the ability to do advanced axis sharing. The current implementation works well for bottom and left label sharing, but failed in sharing labels for top right labels. This PR addresses this problem while at the same time allowing for sharing axes with more complex layouts.

@cvanelteren

This comment was marked as outdated.

@cvanelteren
Copy link
Contributor Author

Problem was not with cleaning the directory.

I am leaving the errors in to indicate in the review what the changes are but we should change them on agreement on how the visuals of the new behavior. If accepted we need to change the docs as well to remain visual fidelity in those images or leave them to signal new behavior.

@cvanelteren
Copy link
Contributor Author

image
this works now properly

Copy link
Collaborator

@beckermr beckermr left a comment

Choose a reason for hiding this comment

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

These two test failures are not related to RNG seeds or the new axis sharing:

Screenshot 2025-06-18 at 5 19 57 AM

They need to be investigated and fixed.

@cvanelteren
Copy link
Contributor Author

When I compare with main locally I am not getting this error:

test.mp4

@cvanelteren
Copy link
Contributor Author

what I did was delete baseline and results; checkout main; generate baselines and then go to this PR and compare with baseline.

@beckermr
Copy link
Collaborator

Well something is different in the CI which indicates a bug or some environment effect. The code needs to work everywhere, not just locally on your machine.

@cvanelteren
Copy link
Contributor Author

At least the network error is gone now 🥳

@cvanelteren
Copy link
Contributor Author

Figured out the problem see #274

@beckermr
Copy link
Collaborator

OK I can proceed on review of this PR.

@cvanelteren
Copy link
Contributor Author

Think the tests that fail are looking good last I checked (prior to latest merge). The issue addresses in #233 is not completely fixed since the partial reversal that happened.

@cvanelteren
Copy link
Contributor Author

Will need to look at layout1 for test_label_sharing_top_right but not no as its getting late ;-)

recoded[axi] = recoded.get(axi, []) + [direction]

# We turn off the tick labels when the scale and
# ticks are shared (level >= 3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see the level checked here. Is that checked somewhere else?

Comment on lines +1980 to +1983
# The axis will be a border if it is either
# (a) on the edge
# (b) not next to a subplot
# (c) not next to a subplot of the same kind
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment seems out of place as none of these items are checked here.

@@ -904,6 +907,185 @@ def units(
return result[0] if singleton else result


def _get_subplot_layout(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This whole function needs many more comments. What is axis_type = 1 and why is it hard coded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants