Skip to content

Commit 87d5792

Browse files
committed
fix iterable type
1 parent 8d8d273 commit 87d5792

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,8 @@ def show(
948948

949949
if wanted_labels_on_this_cs:
950950
if (table := params_copy.table_name) is not None:
951-
colors = sc.get.obs_df(sdata[table], params_copy.color)
951+
keys = [params_copy.color] if not isinstance(params_copy.color, list) else params_copy.color
952+
colors = sc.get.obs_df(sdata[table], keys)
952953
if isinstance(colors.dtype, pd.CategoricalDtype):
953954
_maybe_set_colors(
954955
source=sdata[table],

src/spatialdata_plot/pl/render.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ def _render_points(
439439
)
440440

441441
if col_for_color is not None:
442-
cols = sc.get.obs_df(adata, col_for_color)
442+
keys = [col_for_color] if not isinstance(col_for_color, list) else col_for_color
443+
cols = sc.get.obs_df(adata, keys)
443444
# maybe set color based on type
444445
if isinstance(cols.dtype, pd.CategoricalDtype):
445446
_maybe_set_colors(

0 commit comments

Comments
 (0)