cytonormpy.pl.emd

Contents

cytonormpy.pl.emd#

cytonormpy.pl.emd(cnp, colorby, data=None, channels=None, labels=None, figsize=None, grid=None, grid_n_cols=None, vary_textures=False, ax=None, return_fig=False, show=True, save=None, **kwargs)#

EMD plot visualization.

Parameters:
  • colorby (str) – Selects the coloring of the data points. Can be any of ‘label’, ‘channel’ or ‘improvement’. If ‘improved’, the data points are colored whether the EMD metric improved.

  • data (Optional[DataFrame]) – Optional. If not plotted from a cytonorm object, data can be passed. Has to contain the index columns, ‘label’ and ‘origin’ (containing ‘original’ and ‘normalized’).

  • channels (Optional[Union`[:py:class:`list[str], str]]) – Optional. Can be used to select one or more channels.

  • labels (Optional[Union`[:py:class:`list[str], str]]) – Optional. Can be used to select one or more cell labels.

  • grid (Optional[str]) – Whether to split the plots by the given variable. If left None, all data points are plotted into the same plot. Can be the same inputs as colorby.

  • grid_n_cols (Optional[int]) – The number of columns in the grid.

  • vary_textures (bool) – If True, will plot different markers for the ‘hue’ variable.

  • ax (Optional[ndarray[Sequence[Sequence[Axes]], dtype[object_]], Axes]]) – A Matplotlib Axes to plot into.

  • return_fig (bool) – Returns the figure. Defaults to False.

  • show (bool) – Whether to show the figure.

  • save (Optional[str]) – A string specifying a file path. Defaults to None, where no image is saved.

  • kwargs – keyword arguments ultimately passed to sns.scatterplot.

Returns:

  • If show==False, a Axes.

  • If return_fig==True, a Figure.

Examples

import cytonormpy as cnp

cn = cnp.example_cytonorm()
cnp.pl.emd(cn,
           colorby = "label",
           s = 10,
           linewidth = 0.4,
           edgecolor = "black",
           figsize = (4,4))
../_images/cytonormpy-pl-emd-1.png