pegasus.ridgeplot

pegasus.ridgeplot(data, features, matrix_key=None, donor_attr=None, qc_attr=None, overlap=0.5, left_adjust=0.35, panel_size=(6, 4), return_fig=False, dpi=300.0, **kwargs)[source]

Generate ridge plots, up to 8 features can be shown in one figure.

Parameters
  • data (UnimodalData or MultimodalData object) – Data matrix.

  • features (str or List[str]) – One or more features to display.

  • matrix_key (str, optional, default None) – Which matrix to search features for. If None, use the current matrix.

  • donor_attr (str, optional, default None) – If not None, features must contain only one feature, plot this feature by donor indicated as donor_attr.

  • qc_attr (str, optional, default None) – If not None, only data.obs[qc_attr] == True are used.

  • overlap (float, default 0.5) – Overlap between adjacent ridge plots (top and bottom).

  • left_adjust (float, default 0.35) – Left margin for displaying labels.

  • panel_size (tuple, optional (default: (6, 4))) – The plot size (width, height) in inches.

  • return_fig (bool, optional, default: False) – Return a Figure object if True; return None otherwise.

  • dpi (float, optional, default: 300.0) – The resolution in dots per inch.

Return type

Optional[Figure]

Returns

  • Figure object – A matplotlib.figure.Figure object containing the dot plot if return_fig == True

Examples

>>> fig = pg.ridgeplot(data, features = ['CD8', 'CD4', 'CD3'], dpi = 500)
>>> fig = pg.ridgeplot(data, features = 'CD3', donor_attr = 'assignment', dpi = 500)