Skip to content

Commit

Permalink
fix plot categorical with colors, on labels (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaMarconato authored Dec 26, 2024
1 parent 4666968 commit 271d4bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/napari_spatialdata/_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def _(self, vec: pd.Series, **kwargs: Any) -> dict[str, Any]:
color_dict = dict(zip(vec.cat.categories, colors, strict=False))
color_dict.update({np.nan: "#808080ff"})
else:
color_dict = self.model.adata.uns[vec_color_name]
colors = self.model.adata.uns[vec_color_name]
color_dict = dict(zip(vec.cat.categories, colors.tolist(), strict=True))
else:
df = layer.metadata["_columns_df"]
if vec_color_name not in df.columns:
Expand Down

0 comments on commit 271d4bd

Please sign in to comment.