@@ -154,24 +154,46 @@ def render_shapes(
154
154
** kwargs : Any ,
155
155
) -> sd .SpatialData :
156
156
"""
157
- Render the shapes contained in the given sd. SpatialData object
157
+ Render shapes elements in SpatialData.
158
158
159
159
Parameters
160
160
----------
161
- self :
162
- The sd.SpatialData object.
163
- palette :
164
- A list of colors to use for rendering the images. If `None`, the
165
- default colors will be used.
166
- instance_key :
167
- The name of the column in the table that identifies individual shapes
168
- color_key :
169
- The name of the column in the table to use for coloring shapes.
161
+ element
162
+ The name of the shapes element to render. If `None`, the first
163
+ shapes element in the `SpatialData` object will be used.
164
+ color
165
+ Key for annotations in :attr:`anndata.AnnData.obs` or variables/genes.
166
+ groups
167
+ For discrete annotation in ``color``, select which values
168
+ to plot (other values are set to NAs).
169
+ size
170
+ Value to scale circles, if present.
171
+ outline
172
+ If `True`, a thin border around points/shapes is plotted.
173
+ outline_width
174
+ Width of the border.
175
+ outline_color
176
+ Color of the border.
177
+ alt_var
178
+ Which column to use in :attr:`anndata.AnnData.var` to select alternative ``var_name``.
179
+ layer
180
+ Key in :attr:`anndata.AnnData.layers` or `None` for :attr:`anndata.AnnData.X`.
181
+ palette
182
+ Palette for discrete annotations, see :class:`matplotlib.colors.Colormap`.
183
+ cmap
184
+ Colormap for continuous annotations, see :class:`matplotlib.colors.Colormap`.
185
+ norm
186
+ Colormap normalization for continuous annotations, see :class:`matplotlib.colors.Normalize`.
187
+ na_color
188
+ Color to be used for NAs values, if present.
189
+ alpha
190
+ Alpha value for the shapes.
191
+ kwargs
192
+ Additional arguments to be passed to cmap and norm.
170
193
171
194
Returns
172
195
-------
173
- sd.SpatialData
174
- The input sd.SpatialData with a command added to the plotting tree
196
+ None
175
197
"""
176
198
sdata = self ._copy ()
177
199
sdata = _verify_plotting_tree (sdata )
@@ -210,25 +232,37 @@ def render_points(
210
232
alpha : float = 1.0 ,
211
233
** kwargs : Any ,
212
234
) -> sd .SpatialData :
213
- """Render the points contained in the given sd.SpatialData object
235
+ """
236
+ Render points elements in SpatialData.
214
237
215
238
Parameters
216
239
----------
217
- self :
218
- The sd.SpatialData object.
219
- palette :
220
- A list of colors to use for rendering the images. If `None`, the
221
- default colors will be used.
222
- instance_key :
223
- The name of the column in the table that identifies individual shapes
224
- color : str or None, optional (default: None)
225
- The name of the column in the table to use for coloring shapes.
240
+ element
241
+ The name of the points element to render. If `None`, the first
242
+ shapes element in the `SpatialData` object will be used.
243
+ color
244
+ Key for annotations in :attr:`anndata.AnnData.obs` or variables/genes.
245
+ groups
246
+ For discrete annotation in ``color``, select which values
247
+ to plot (other values are set to NAs).
248
+ size
249
+ Value to scale points.
250
+ palette
251
+ Palette for discrete annotations, see :class:`matplotlib.colors.Colormap`.
252
+ cmap
253
+ Colormap for continuous annotations, see :class:`matplotlib.colors.Colormap`.
254
+ norm
255
+ Colormap normalization for continuous annotations, see :class:`matplotlib.colors.Normalize`.
256
+ na_color
257
+ Color to be used for NAs values, if present.
258
+ alpha
259
+ Alpha value for the shapes.
260
+ kwargs
261
+ Additional arguments to be passed to cmap and norm.
226
262
227
263
Returns
228
264
-------
229
- sd.SpatialData
230
- The input sd.SpatialData with a command added to the plotting tree
231
-
265
+ None
232
266
"""
233
267
sdata = self ._copy ()
234
268
sdata = _verify_plotting_tree (sdata )
@@ -261,24 +295,30 @@ def render_images(
261
295
alpha : float = 1.0 ,
262
296
** kwargs : Any ,
263
297
) -> sd .SpatialData :
264
- """Render the images contained in the given sd.SpatialData object
298
+ """
299
+ Render image elements in SpatialData.
265
300
266
301
Parameters
267
302
----------
268
- self :
269
- The sd.SpatialData object.
270
- palette :
271
- A list of colors to use for rendering the images. If `None`, the
272
- default colors will be used.
273
- trans_fun :
274
- A function to apply to the images before rendering. If `None`, no
275
- function will be applied.
303
+ element
304
+ The name of the image element to render. If `None`, the first
305
+ shapes element in the `SpatialData` object will be used.
306
+ channel
307
+ To select which channel to plot (all by default).
308
+ cmap
309
+ Colormap for continuous annotations, see :class:`matplotlib.colors.Colormap`.
310
+ norm
311
+ Colormap normalization for continuous annotations, see :class:`matplotlib.colors.Normalize`.
312
+ na_color
313
+ Color to be used for NAs values, if present.
314
+ alpha
315
+ Alpha value for the shapes.
316
+ kwargs
317
+ Additional arguments to be passed to cmap and norm.
276
318
277
319
Returns
278
320
-------
279
- sd.SpatialData
280
- The input sd.SpatialData with a command added to the plotting tree
281
-
321
+ None
282
322
"""
283
323
sdata = self ._copy ()
284
324
sdata = _verify_plotting_tree (sdata )
@@ -315,37 +355,44 @@ def render_labels(
315
355
alpha : float = 1.0 ,
316
356
** kwargs : Any ,
317
357
) -> sd .SpatialData :
318
- """Render the labels contained in the given sd.SpatialData object
358
+ """
359
+ Render labels elements in SpatialData.
319
360
320
361
Parameters
321
362
----------
322
- self :
323
- sd.SpatialData
324
- instance_key :
325
- The name of the column in the table that identifies individual labels
363
+ element
364
+ The name of the labels element to render. If `None`, the first
365
+ labels element in the `SpatialData` object will be used.
366
+ color
367
+ Key for annotations in :attr:`anndata.AnnData.obs` or variables/genes.
368
+ groups
369
+ For discrete annotation in ``color``, select which values
370
+ to plot (other values are set to NAs).
371
+ contour_px
372
+ Draw contour of specified width for each segment. If `None`, fills
373
+ entire segment, see :func:`skimage.morphology.erosion`.
374
+ outline
375
+ Whether to plot boundaries around segmentation masks.
376
+ alt_var
377
+ Which column to use in :attr:`anndata.AnnData.var` to select alternative ``var_name``.
378
+ layer
379
+ Key in :attr:`anndata.AnnData.layers` or `None` for :attr:`anndata.AnnData.X`.
380
+ palette
381
+ Palette for discrete annotations, see :class:`matplotlib.colors.Colormap`.
382
+ cmap
383
+ Colormap for continuous annotations, see :class:`matplotlib.colors.Colormap`.
384
+ norm
385
+ Colormap normalization for continuous annotations, see :class:`matplotlib.colors.Normalize`.
386
+ na_color
387
+ Color to be used for NAs values, if present.
388
+ alpha
389
+ Alpha value for the labels.
390
+ kwargs
391
+ Additional arguments to be passed to cmap and norm.
326
392
327
393
Returns
328
394
-------
329
- sd.SpatialData
330
- The input sd.SpatialData with a command added to the plotting tree
331
-
332
- Raises
333
- ------
334
- TypeError
335
- If any of the parameters have an invalid type.
336
- ValueError
337
- If any of the parameters have an invalid value.
338
- If the provided instance_key or color_key is not a valid table column.
339
- If the provided mode is not one of 'thick', 'inner', 'outer', or
340
- 'subpixel'.
341
-
342
- Notes
343
- -----
344
- This function plots cell labels for a spatialdata object. The cell labels are
345
- based on a column in the table, and can optionally be colored based on another
346
- column in the table. The resulting plot can be customized by specifying the
347
- alpha, color, and rendering mode of the labels, as well as whether to add a
348
- legend to the plot.
395
+ None
349
396
"""
350
397
if (
351
398
color is not None
0 commit comments