Skip to content

Commit a643124

Browse files
committed
update
1 parent 1054298 commit a643124

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -611,15 +611,8 @@ def show(
611611
)
612612

613613
elif cmd == "render_points":
614-
for idx, ax in enumerate(axs):
615-
key = list(sdata.points.keys())[idx]
616-
if params["color_key"] is not None:
617-
if params["color_key"] not in sdata.points[key].columns:
618-
raise ValueError(
619-
f"The column '{params['color_key']}' is not present in the 'metadata' of the points."
620-
)
621-
622-
_render_points(sdata=sdata, params=params, key=key, ax=ax, extent=extent)
614+
key = list(sdata.points.keys())[0] # TODO: remove, hack
615+
_render_points(sdata=sdata, params=params, key=key, ax=fig_params.ax, extent=extent)
623616

624617
elif cmd == "render_labels":
625618
if (

src/spatialdata_plot/pl/render.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ def _get_collection_shape(
113113
patches = [Circle(circ, radius=r * s) for circ, r in zip(shapes["geometry"], shapes["radius"])]
114114

115115
collection = PatchCollection(patches, snap=False, **kwargs)
116-
print(c)
117116
if isinstance(c, np.ndarray) and np.issubdtype(c.dtype, np.number):
118117
collection.set_array(np.ma.masked_invalid(c))
119118
collection.set_norm(norm)
@@ -153,6 +152,7 @@ def _get_collection_shape(
153152
rasterized=sc_settings._vector_friendly,
154153
cmap=render_params.cmap_params.cmap,
155154
norm=norm,
155+
alpha=render_params.alpha,
156156
# **kwargs,
157157
)
158158
cax = ax.add_collection(_cax)

src/spatialdata_plot/pl/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
from matplotlib.collections import Collection, PatchCollection
3535
from scanpy._settings import settings as sc_settings
3636
from scanpy.plotting._tools.scatterplots import _add_categorical_legend
37+
from spatialdata._logging import logger as logging
3738

3839
Palette_t = Optional[Union[str, ListedColormap]]
3940
_Normalize = Union[Normalize, Sequence[Normalize]]
@@ -517,7 +518,7 @@ def _get_palette(
517518
)
518519
return {cat: to_hex(to_rgba(col)[:3]) for cat, col in zip(categories, palette)}
519520
except KeyError as e:
520-
print(e)
521+
logging.warning(e)
521522
return None
522523

523524
len_cat = len(categories)

0 commit comments

Comments
 (0)