Skip to content

Fix plot_multicomparison_fc ValueError with default figsize#965

Merged
Zethson merged 1 commit into
scverse:mainfrom
kimjune01:fix-plot-multicomparison-fc-755
May 11, 2026
Merged

Fix plot_multicomparison_fc ValueError with default figsize#965
Zethson merged 1 commit into
scverse:mainfrom
kimjune01:fix-plot-multicomparison-fc-755

Conversation

@kimjune01
Copy link
Copy Markdown
Contributor

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

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-commenter
Copy link
Copy Markdown

codecov-commenter commented May 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.85%. Comparing base (12897e1) to head (6219369).
⚠️ Report is 57 commits behind head on main.

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     
Files with missing lines Coverage Δ
...ertpy/tools/_differential_gene_expression/_base.py 90.24% <ø> (+1.21%) ⬆️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

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

Thank you very much!

@Zethson Zethson merged commit d8ed067 into scverse:main May 11, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buggy defaults for plot_multicomparison_fc

3 participants