stereo.plots.PlotCollection.cluster_scatter

PlotCollection.cluster_scatter(res_key, groups=None, show_others=None, others_color='#828282', title=None, x_label=None, y_label=None, dot_size=None, palette='stereo_30', invert_y=True, hue_order=None, width=None, height=None, base_image=None, base_im_cmap='Greys', base_im_to_gray=False, **kwargs)[source]

Spatial scatter distribution of clusters.

Parameters:
  • res_key (str) – cluster result key.

  • groups (Union[list, ndarray, str, None]) – the group names.

  • show_others (Optional[bool]) – whether to show others when groups is not None. by default, if base_image is None, show_others is True, otherwise show_others is False.

  • others_color (Optional[str]) – the color of others, only available when groups is not None and show_others is True.

  • title (Optional[str]) – the plot title, defaults to None to be set as res_key, set it to False to disable the title.

  • x_label (Optional[str]) – the x label.

  • y_label (Optional[str]) – the y label.

  • dot_size (Optional[int]) – the dot size.

  • palette (Union[str, list, dict, None]) – a palette name, a list of colors whose length at least equal to the groups to be shown or a dict whose keys are the groups and values are the colors.

  • invert_y (Optional[bool]) – whether to invert y-axis.

  • hue_order (Optional[set]) – the classification method.

  • width (Optional[int]) – the figure width in pixels.

  • height (Optional[int]) – the figure height in pixels.

  • base_image (Optional[str]) – the path of mask image to be displayed as background, it must already be registered to the same coordinate system as the data.

  • base_im_cmap (Optional[str]) – the color map of the base image, only availabel when base image is gray scale image.

  • base_im_to_gray (bool) – whether to convert the base image to gray scale if base image is RGB/RGBA image.

  • show_plotting_scale – wheter to display the plotting scale.

  • out_path – the path to save the figure.

  • out_dpi – the dpi when the figure is saved.

  • reorganize_coordinate

    if the data is merged from several slices, whether to reorganize the coordinates of the obs(cells), if set it to a number, like 2, the coordinates will be reorganized to 2 columns on coordinate system as below:

    data1 data2
    data3 data4
    data5 …
    … …

    if set it to False, the coordinates will not be changed.

  • horizontal_offset_additional – the additional offset between each slice on horizontal direction while reorganizing coordinates.

  • vertical_offset_additional – the additional offset between each slice on vertical direction while reorganizing coordinates.

Returns:

Spatial scatter distribution of clusters.