Commit 6855232
committed
feat(plotting): Add group_cmaps to sc.pl.dotplot for custom per-group coloring
- 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 (dots overlapping in size legend, especially when dendrogram=True) by setting the legends width to 2.0 (compared to DEFAULT_LEGENDS_WIDTH = 1.5) inside the dotplot wrapper function.
- 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 6855232
File tree
17 files changed
+282
-77
lines changed- docs/release-notes
- src/scanpy/plotting
- tests
- _images
- dotplot2
- dotplot3
- dotplot_dict
- dotplot_gene_symbols
- dotplot_group_cmaps_swap_axes
- dotplot_group_cmaps
- dotplot_groupby_index
- dotplot_groupby_list_catorder
- dotplot_std_scale_group
- dotplot_std_scale_var
- dotplot_totals
- dotplot
- multiple_plots
- ranked_genes_dotplot
17 files changed
+282
-77
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Large diffs are not rendered by default.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
0 commit comments