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

Category colors not rendering properly #110

Open
ltsypin opened this issue May 6, 2022 · 1 comment
Open

Category colors not rendering properly #110

ltsypin opened this issue May 6, 2022 · 1 comment

Comments

@ltsypin
Copy link

ltsypin commented May 6, 2022

Hello! Thank you for developing this package.

I'm having an issue where my column categories are getting assigned appropriate colors, but the row categories are not. When I look at net.viz['cat_colors'], I see:

{'row': {'cat-0': {'UMAP/Leiden: 0': '#393b79',
   'UMAP/Leiden: 1': '#ff7f0e',
   'UMAP/Leiden: 10': '#98df8a',
   'UMAP/Leiden: 11': '#404040',
   'UMAP/Leiden: 12': '#c5b0d5',
   'UMAP/Leiden: 13': '#1f77b4',
   'UMAP/Leiden: 14': '#FFDB58',
   'UMAP/Leiden: 15': '#e377c2',
   'UMAP/Leiden: 16': '#2ca02c',
   'UMAP/Leiden: 17': '#dbdb8d',
   'UMAP/Leiden: 18': '#637939',
   'UMAP/Leiden: 19': '#9c9ede',
   'UMAP/Leiden: 2': '#8ca252',
   'UMAP/Leiden: 20': '#bd9e39',
   'UMAP/Leiden: 21': '#843c39',
   'UMAP/Leiden: 22': '#d6616b',
   'UMAP/Leiden: 23': '#a55194',
   'UMAP/Leiden: 24': '#de9ed6',
   'UMAP/Leiden: 25': '#aec7e8',
   'UMAP/Leiden: 26': '#ffbb78',
   'UMAP/Leiden: 27': '#bcbd22',
   'UMAP/Leiden: 28': '#ff9896',
   'UMAP/Leiden: 29': '#8c564b',
   'UMAP/Leiden: 3': '#5254a3',
   'UMAP/Leiden: 4': '#c49c94',
   'UMAP/Leiden: 5': '#7f7f7f',
   'UMAP/Leiden: 6': '#9467bd',
   'UMAP/Leiden: 7': '#17becf',
   'UMAP/Leiden: 8': '#6b6ecf',
   'UMAP/Leiden: 9': '#d62728'}},
 'col': {'cat-0': {'phase: growth': '#393b79',
   'phase: sexual': '#ff7f0e',
   'phase: starve': '#98df8a'}}}

But the actual widget shows up like this:

image

This happens on both Firefox and Chrome. It's very hard for me to distinguish the shades of gray, and it would be much more useful for my data exploration if there were clear, contrasting colors. I've tried updating the hex codes myself using set_cat_color(), but that had no effect.

Could you please advise how I might fix this?

Thanks!

@cornhundred
Copy link
Contributor

Hi @ltsypin, yes there is a new method for setting global category colors - you can see an example of it here on this Google Colab notebook

net.set_global_cat_colors(df_colors)

where df_colors is a DataFrame with a single column named colors and the rows are the names of categories. This coloring scheme will be used for any row/col category.

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

2 participants