Skip to content

Commit 48227ca

Browse files
authored
fixed bug (#34)
1 parent 549a6eb commit 48227ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/spatialdata_plot/pl/render.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ def _render_shapes(
5959
if sdata.table is not None and isinstance(params["instance_key"], str) and isinstance(params["color_key"], str):
6060
colors = [to_rgb(c) for c in sdata.table.uns[f"{params['color_key']}_colors"]]
6161

62-
else:
63-
assert isinstance(params["palette"], Iterable)
62+
elif isinstance(params["palette"], str):
63+
colors = [params["palette"]]
64+
elif isinstance(params["palette"], Iterable):
6465
colors = [to_rgb(c) for c in list(params["palette"])]
66+
else:
67+
# assert isinstance(params["palette"], Iterable)
68+
colors = [params["palette"]]
6569

6670
ax.set_xlim(extent["x"][0], extent["x"][1])
6771
ax.set_ylim(extent["y"][0], extent["y"][1])

0 commit comments

Comments
 (0)