Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to defined the color myself in paga node ? #33

Open
honghh2018 opened this issue Nov 5, 2024 · 0 comments
Open

how to defined the color myself in paga node ? #33

honghh2018 opened this issue Nov 5, 2024 · 0 comments

Comments

@honghh2018
Copy link

Hi developer,
I want to defined the color in paga plot node?
and i can defined it properly.
how to define the color that i want in page node plot
color_map_dict = {}
cluster_name = adata.obs['cluster'].unique()
if len(colors)>0:
for i in range(len(cluster_name)):
color_map_dict.update({cluster_name[i]: colors[i]})
else:
for i in range(len(cluster_name)):
color_map_dict.update({cluster_name[i]: cluster_name[i]})

adata.obs['cluster_color'] = adata.obs['cluster'].map(color_map_dict)

sc.pl.paga(adata, color='cluster_color', ax=axes[0, 0], show=False)
it not work for this code
any advice would be appreciated.
Best,
hanhuihong

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

No branches or pull requests

1 participant