stereo.plots.PlotMsSpatialScatter.ms_spatial_scatter¶
- PlotMsSpatialScatter.ms_spatial_scatter(color_by='total_counts', color_key=None, ncols=3, dot_size=15, palette=None, width=None, height=None, x_label='spatial1', y_label='spatial2', vmin=None, vmax=None, marker='o', invert_y=True, use_raw=True)[source]¶
Plot spatial scatter plot for multiple slices. Each slice will be shown in a single plot.
- Parameters:
color_by (
Literal['total_counts','n_genes_by_counts','gene','cluster']) – spcify the way of coloring, default to ‘total_counts’. if set to ‘gene’, you need to specify a gene name bycolor_key. if set to ‘cluster’, you need to specify the key to get cluster result bycolor_key.color_key (
Optional[str]) – the key to get the data to color the plot, it is ignored when thecolor_byis set to ‘total_counts’ or ‘n_genes_by_counts’.ncols (
Optional[int]) – the slices in plot will be shown asncolscolumns, defaults to 3.nrowswill be calculated automatically based on ncols and the number of slices.dot_size (
Optional[int]) – size of markers in plot, defaults to 15.palette (
Optional[str]) – palette used to color, defaults to None. by default, it will be set to a palette customized by stereo. more palettes refer to matplotlib.colors.width (
Optional[int]) – the plot width in pixels, defaults to None. by default, it will be set to 6 times ofncols.height (
Optional[int]) – the plot height in pixels, defaults to None. by default, it will be set to 6 times ofnrows.x_label (
Union[str,list,None]) – the label of x-axis, defaults to ‘spatial1’.y_label (
Union[str,list,None]) – the label of y-axis, defaults to ‘spatial2’.vmin (
Optional[float]) – The value representing the lower limit of the color scale. Values smaller than vmin are plotted with the same color as vmin.vmax (
Optional[float]) – The value representing the higher limit of the color scale. Values greater than vmax are plotted with the same color as vmax. vmin and vmax will be ignored whencolor_byis ‘cluster’. by default, vmin and vmax are set to the min and max of the color data.marker (
str) – the marker style, defaults to ‘o’. valid values refer to matplotlib.markers.invert_y (
bool) – whether to invert the y-axis, defaults to True.use_raw (
bool) – wheter to use raw data whencolor_byis ‘gene’, defaults to True. set to False automatically when raw data is not available.
- Returns:
the figure object.