Skip to content

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

@honghh2018

Description

@honghh2018

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions