scirpy.pl.base.curve

Contents

scirpy.pl.base.curve#

scirpy.pl.base.curve(data, *, ax=None, curve_layout='overlay', shade=True, kde_norm=True, order=None, kernel_kws=None, color=None, style='default', style_kws=None, fig_kws=None, **kwargs)#

Basic plotting function for drawing KDE-smoothed curves.

Primarily designed for the scirpy.pl.spectratype() plotting function.

Parameters:
  • data (dict) – Weighted counts for KDE.

  • ax (Optional[Axes] (default: None)) – Custom axis if needed.

  • curve_layout (Literal['overlay', 'stacked', 'shifetd'] (default: 'overlay')) – if the KDE-based curves should be stacked or shifted vetrically.

  • kde_norm (bool (default: True)) – KDE curves are by default normalized to a sum of 1. Set to False in order to keep normalized cell weights.

  • kernel_kws (Optional[dict] (default: None)) – Parameters that should be passed to KernelDensity function of sklearn.

  • order (Optional[list] (default: None)) – Specifies the order of groups.

  • shade (bool (default: True)) – If True, draw a shade between curves

  • color (Optional[Sequence[str]] (default: None)) – List of colors for each curve

  • style (Optional[Literal['default']] (default: 'default')) – Style to apply to the axes. Currently supported are None (disable styling) and default (default style).

  • style_kws (Optional[dict] (default: None)) – Parameters passed to scirpy.pl.styling.style_axes()

  • fig_kws (Optional[dict] (default: None)) – Parameters passed to the matplotlib.pyplot.figure() call if no ax is specified. Defaults to {'figsize': (3.44, 2.58), 'dpi': 120} if None.

Return type:

Axes

Returns:

Axes object.