Skip to content

Commit 29227a0

Browse files
committed
feat(plotting): Add group_cmaps to sc.pl.dotplot
- Adds the group_cmaps parameter to sc.pl.dotplot, allowing users to specify a unique colormap for each group. - Implements a corresponding stacked colorbar legend (_plot_stacked_colorbars) to display the multiple colormaps, with group labels for clarity. - Adds robust error handling, raising a ValueError if a plotted group is not defined in the group_cmaps dictionary. - Fixes a pre-existing layout bug by increasing DEFAULT_LEGENDS_WIDTH from 1.5 to 1.7, which prevents circles in the size legend from overlapping. - Refactors data preparation logic from DotPlot.__init__ into a new _prepare_dot_data helper method. This was done to improve code quality and resolve pre-commit linter errors related to complexity. - Includes comprehensive tests for the new functionality, swap-axis compatibility, and error conditions.
1 parent f5d5855 commit 29227a0

File tree

33 files changed

+296
-79
lines changed

33 files changed

+296
-79
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Added `group_cmaps` parameter to `sc.pl.dotplot` for custom per-group coloring.

src/scanpy/plotting/_dotplot.py

Lines changed: 222 additions & 78 deletions
Large diffs are not rendered by default.

tests/_images/dotplot/expected.png

-897 Bytes
Loading
-2.04 KB
Loading
-1.26 KB
Loading
-771 Bytes
Loading
-884 Bytes
Loading
15.4 KB
Loading
14.9 KB
Loading
-1.88 KB
Loading

0 commit comments

Comments
 (0)