-
Notifications
You must be signed in to change notification settings - Fork 709
Description
...
colors_use = ['red', 'blue', 'green', 'purple', 'yellow', 'brown', 'black', 'peru', 'orange', 'olive',
'darksage', 'cyan', 'lime', 'pink', 'teal', 'violet', 'darkblue', 'magenta', 'coral', 'gray']
adata = sc.AnnData(embedding)
adata.obs["category"] = label.astype(np.int)
adata.obs["domain"] = batch.astype(np.int)
sc.tl.tsne(adata, use_rep = 'X', n_jobs = 10)
adata.uns["category_colors"] = list(colors_use[:len(np.unique(label))])
adata.uns["domain_colors"] = list(colors_use[:len(np.unique(batch))])
sc.pl.tsne(adata, color = ["category", "domain"], title = ["class", "domain"],
show = False, size = 50000 / len(label), save = "/{}.pdf".format(file))
My scanpy version is 1.4.6, but when I run the above codes, I find that the color is continuous, why cannot set my specific color?