We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 53421a5 commit 7cb3133Copy full SHA for 7cb3133
1 file changed
src/spatialdata_plot/pl/basic.py
@@ -1525,6 +1525,18 @@ def _draw_colorbar(
1525
if fig_params.frameon is False:
1526
ax.axis("off")
1527
1528
+ if has_shapes and wants_shapes:
1529
+ empty_shape_elements = [
1530
+ name
1531
+ for name in wanted_elements
1532
+ if name in sdata.shapes and not sdata.shapes[name]["geometry"].apply(lambda g: not g.is_empty).any()
1533
+ ]
1534
+ if empty_shape_elements:
1535
+ raise ValueError(
1536
+ f"Cannot render shape element(s) {empty_shape_elements} in coordinate system {cs!r}: "
1537
+ "all geometries are empty. Drop the element or restore at least one non-empty geometry."
1538
+ )
1539
+
1540
extent = get_extent(
1541
sdata,
1542
coordinate_system=cs,
0 commit comments