Skip to content

Commit f9d2cf4

Browse files
author
Sonja Stockhaus
committed
update documentation
1 parent 7eb6baa commit f9d2cf4

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

src/spatialdata_plot/pl/basic.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,18 @@ def render_shapes(
186186
element : str | None, optional
187187
The name of the shapes element to render. If `None`, all shapes elements in the `SpatialData` object will be
188188
used.
189-
color : ColorLike | None
189+
color : ColorLike | None, optional
190190
Can either be color-like (name of a color as string, e.g. "red", hex representation, e.g. "#000000" or
191191
"#000000ff", or an RGB(A) array as a tuple or list containing 3-4 floats within [0, 1]. If an alpha value is
192192
indicated, the value of `fill_alpha` takes precedence if given) or a string representing a key in
193193
:attr:`sdata.table.obs`. The latter can be used to color by categorical or continuous variables. If
194194
`element` is `None`, if possible the color will be broadcasted to all elements. For this, the table in which
195195
the color key is found must annotate the respective element (region must be set to the specific element). If
196196
the color column is found in multiple locations, please provide the table_name to be used for the elements.
197-
fill_alpha : float | int | None, default 1.0
198-
Alpha value for the fill of shapes. If an alpha channel is present in a cmap passed by the user, this
199-
value will overwrite the value present in the cmap.
197+
fill_alpha : float | int | None, optional
198+
Alpha value for the fill of shapes. By default, it is set to 1.0 or, if a color is given that implies an
199+
alpha, that value is used for `fill_alpha`. If an alpha channel is present in a cmap passed by the user,
200+
`fill_alpha` will overwrite the value present in the cmap.
200201
groups : list[str] | str | None
201202
When using `color` and the key represents discrete labels, `groups` can be used to show only a subset of
202203
them. Other values are set to NA. If elment is None, broadcasting behaviour is attempted (use the same
@@ -209,14 +210,18 @@ def render_shapes(
209210
Color to be used for NA values, if present. Can either be a named color ("red"), a hex representation
210211
("#000000ff") or a list of floats that represent RGB/RGBA values (1.0, 0.0, 0.0, 1.0). When None, the values
211212
won't be shown.
212-
outline_width : float | int | tuple[float | int, float | int], default 1.5
213+
outline_width : float | int | tuple[float | int, float | int], optional
213214
Width of the border. If 2 values are given (tuple), 2 borders are shown with these widths (outer & inner).
214-
outline_color : ColorLike | tuple[ColorLike], default "#000000"
215+
If `outline_color` and/or `outline_alpha` are used to indicate that one/two outlines should be drawn, the
216+
default outline widths 1.5 and 0.5 are used for outer/only and inner outline respectively.
217+
outline_color : ColorLike | tuple[ColorLike], optional
215218
Color of the border. Can either be a named color ("red"), a hex representation ("#000000") or a list of
216219
floats that represent RGB/RGBA values (1.0, 0.0, 0.0, 1.0). If the hex representation includes alpha, e.g.
217220
"#000000ff", and `outline_alpha` is not given, this value controls the opacity of the outline. If 2 values
218-
are given (tuple), 2 borders are shown with these colors (outer & inner).
219-
outline_alpha : float | int | tuple[float | int, float | int] | None
221+
are given (tuple), 2 borders are shown with these colors (outer & inner). If `outline_width` and/or
222+
`outline_alpha` are used to indicate that one/two outlines should be drawn, the default outline colors
223+
"#000000" and "#ffffff are used for outer/only and inner outline respectively.
224+
outline_alpha : float | int | tuple[float | int, float | int] | None, optional
220225
Alpha value for the outline of shapes. Invisible by default, meaning outline_alpha=0.0 if both outline_color
221226
and outline_width are not specified. Else, outlines are rendered with the alpha implied by outline_color, or
222227
with outline_alpha=1.0 if outline_color does not imply an alpha. For two outlines, alpha values can be
@@ -352,16 +357,17 @@ def render_points(
352357
element : str | None, optional
353358
The name of the points element to render. If `None`, all points elements in the `SpatialData` object will be
354359
used.
355-
color : str | None
360+
color : str | None, optional
356361
Can either be color-like (name of a color as string, e.g. "red", hex representation, e.g. "#000000" or
357362
"#000000ff", or an RGB(A) array as a tuple or list containing 3-4 floats within [0, 1]. If an alpha value is
358363
indicated, the value of `fill_alpha` takes precedence if given) or a string representing a key in
359364
:attr:`sdata.table.obs`. The latter can be used to color by categorical or continuous variables. If
360365
`element` is `None`, if possible the color will be broadcasted to all elements. For this, the table in which
361366
the color key is found must annotate the respective element (region must be set to the specific element). If
362367
the color column is found in multiple locations, please provide the table_name to be used for the elements.
363-
alpha : float | int | None, default 1.0
364-
Alpha value for the points.
368+
alpha : float | int | None, optional
369+
Alpha value for the points. By default, it is set to 1.0 or, if a color is given that implies an alpha, that
370+
value is used instead.
365371
groups : list[str] | str | None
366372
When using `color` and the key represents discrete labels, `groups` can be used to show only a subset of
367373
them. Other values are set to NA. If `element` is `None`, broadcasting behaviour is attempted (use the same
@@ -637,7 +643,7 @@ def render_labels(
637643
won't be shown.
638644
outline_alpha : float | int, default 0.0
639645
Alpha value for the outline of the labels. Invisible by default.
640-
fill_alpha : float | int, default 0.3
646+
fill_alpha : float | int, default 0.4
641647
Alpha value for the fill of the labels.
642648
scale : str | None
643649
Influences the resolution of the rendering. Possibilities for setting this parameter:

0 commit comments

Comments
 (0)