scverse / scverse/scanpy

sc.pl.paga_path: n_avg>1 messes up legend

Open
#274 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Example:

import scanpy.api as sc
adata = sc.datasets.blobs()
sc.pp.neighbors(adata)
sc.tl.louvain(adata)
sc.tl.paga(adata)
adata.uns['iroot'] = 0
sc.tl.dpt(adata)
sc.pl.paga_path(adata, nodes=['1', '2'], keys=['1', '2'], n_avg=1, as_heatmap=False)
sc.pl.paga_path(adata, nodes=['1', '2'], keys=['1', '2'], n_avg=2, as_heatmap=False)

Output:
image
image
I would expect that the legend in both plots stays the same.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided example and inspect the implementation behind sc.pl.paga_path, comparing the n_avg=1 and n_avg=2 plots. Trace how the legend is built for each call and verify that the legend remains consistent between both outputs when the fix is complete.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.