feat(show): add xlabel/ylabel to control panel axis labels - #766
Merged
Conversation
Adds show(axis_label=...) to set x/y axis labels on every rendered panel, mirroring squidpy's spatial_scatter kwarg. Accepts a single string (both axes) or an (x, y) pair; None keeps the current unlabelled behavior. Closes #763
Replaces the overloaded axis_label (str | pair) with separate xlabel/ylabel str params, matching matplotlib's set_xlabel/set_ylabel. squidpy's axis_label carries different semantics (numeric suffixes, default-on), so matching its name without its behavior added a union type for no interop benefit.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #766 +/- ##
==========================================
+ Coverage 79.63% 79.66% +0.03%
==========================================
Files 18 18
Lines 4665 4672 +7
Branches 1032 1036 +4
==========================================
+ Hits 3715 3722 +7
Misses 599 599
Partials 351 351
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #763.
Adds
show(xlabel=..., ylabel=...)to set the x/y axis labels on every rendered panel. Previously callers (squidpy'sspatial_scatter/spatial_segment) had to reach into the returned axes and callset_xlabel/set_ylabelper panel.str | None;None(default) leaves that axis unlabelled (current behavior)._finalize_panelnext to the existingset_title, so they broadcast to all panels and work with user-supplied axes.Named
xlabel/ylabelto match matplotlib rather than squidpy'saxis_label: squidpy's variant is an overloadedstr | Sequencewhose str case adds numeric suffixes and whose default draws labels, so matching only the name would inherit a union type while behaving differently. Two plain string params keep the interface unambiguous and one-thing-per-param.Tests
tests/pl/test_show.py: labels set per axis, one-axis-only, empty by default, broadcast across a multi-panel plot; validation rejects non-str inputs.