Fix plot_multicomparison_fc ValueError with default figsize#965
Merged
Conversation
Fixes scverse#755 The function failed when seaborn's heatmap didn't display tick labels (which happens with certain figsize values). This occurred because the code assumed tick labels would always be present when plotting significance markers. The fix ensures xticklabels=True and yticklabels=True are set by default, while still allowing users to override via heatmap_kwargs. Changes: - Set default xticklabels=True and yticklabels=True in heatmap call - Add regression test for default figsize behavior
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #965 +/- ##
==========================================
- Coverage 73.54% 71.85% -1.69%
==========================================
Files 48 48
Lines 5613 5731 +118
==========================================
- Hits 4128 4118 -10
- Misses 1485 1613 +128
🚀 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.
Seaborn heatmap hides tick labels when the figure is too narrow, causing a ValueError when plot_multicomparison_fc tries to place significance markers. The code looks up gene names in x_labels, but those labels are missing when the heatmap suppresses them.
This sets xticklabels=True and yticklabels=True as defaults so tick labels are always visible. Users can still override these via heatmap_kwargs if needed.
Fixes #755