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', title=None, 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 by color_key. if set to ‘cluster’, you need to specify the key to get cluster result by color_key.

  • color_key (Optional[str]) – the key to get the data to color the plot, it is ignored when the color_by is set to ‘total_counts’ or ‘n_genes_by_counts’.

  • ncols (Optional[int]) – the slices in plot will be shown as ncols columns, defaults to 3. nrows will 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 of ncols.

  • height (Optional[int]) – the plot height in pixels, defaults to None. by default, it will be set to 6 times of nrows.

  • 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’.

  • title (Optional[str]) – the title of each slice plot, defaults to None.

  • 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 when color_by is ‘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 when color_by is ‘gene’, defaults to True. set to False automatically when raw data is not available.

Returns:

the figure object.