scanpy icon indicating copy to clipboard operation
scanpy copied to clipboard

✨ Add colorblocks to baseplot similar to heatmap

Open mbuttner opened this issue 1 year ago • 1 comments

Hi there, I wrote a color annotation function for the Baseplot class called add_colorblocks(), which borrows some functionality of the add_totals() function and creates a colorblock for the annotation each assigned group.

sc.pl.dotplot(adata, ["CD79A", "MS4A1"], "bulk_labels", return_fig=True, show=False,
                   #swap_axes=True
                   ).add_colorblocks(color='Paired', size=0.1).show()

image

  • [x] Addresses #2194
  • [x] Tests included or not required because: plotting
  • [ ] Release notes not necessary because:

mbuttner avatar May 02 '24 16:05 mbuttner

Codecov Report

Attention: Patch coverage is 47.72727% with 23 lines in your changes are missing coverage. Please review.

Project coverage is 76.18%. Comparing base (0d4554b) to head (efcf8df).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3043      +/-   ##
==========================================
- Coverage   76.27%   76.18%   -0.10%     
==========================================
  Files         117      117              
  Lines       12795    12838      +43     
==========================================
+ Hits         9760     9780      +20     
- Misses       3035     3058      +23     
Files Coverage Δ
scanpy/plotting/_baseplot_class.py 85.21% <47.72%> (-4.68%) :arrow_down:

codecov[bot] avatar May 02 '24 17:05 codecov[bot]