Skip to content

Commit 9e4274c

Browse files
committed
adjust for scanpy returning df
1 parent 6854121 commit 9e4274c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ def show(
949949
if wanted_labels_on_this_cs:
950950
if (table := params_copy.table_name) is not None:
951951
colors = sc.get.obs_df(sdata[table], params_copy.color)
952-
if isinstance(colors.dtype, pd.CategoricalDtype):
952+
if isinstance(colors[params_copy.color].dtype, pd.CategoricalDtype):
953953
_maybe_set_colors(
954954
source=sdata[table],
955955
target=sdata[table],

src/spatialdata_plot/pl/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def _render_points(
441441
if col_for_color is not None:
442442
cols = sc.get.obs_df(adata, col_for_color)
443443
# maybe set color based on type
444-
if isinstance(cols.dtype, pd.CategoricalDtype):
444+
if isinstance(cols[col_for_color].dtype, pd.CategoricalDtype):
445445
_maybe_set_colors(
446446
source=adata,
447447
target=adata,

0 commit comments

Comments
 (0)