Skip to content

Commit 7dfb879

Browse files
author
Sonja Stockhaus
committed
small bugfix for coloring multiple shapes elements by annotation
1 parent 3ab73ea commit 7dfb879

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/spatialdata_plot/pl/render.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ def _render_shapes(
148148
if not (
149149
len(set(color_vector)) == 1 and list(set(color_vector))[0] == to_hex(render_params.cmap_params.na_color)
150150
):
151+
# necessary in case different shapes elements are annotated with one table
152+
if color_source_vector is not None:
153+
color_source_vector = color_source_vector.remove_unused_categories()
151154
_ = _decorate_axs(
152155
ax=ax,
153156
cax=cax,

0 commit comments

Comments
 (0)