scHopfield.plotting.plot_eigenvector_components

scHopfield.plotting.plot_eigenvector_components(adata: AnnData, cluster: str, which: str = 'max', n_genes: int = 10, cluster_key: str = 'cell_type', color: str | None = None, annotate: bool = True, figsize: tuple = (10, 5), ax: Axes | None = None) Axes[source]

Plot sorted eigenvector components with top gene annotations.

Parameters:
  • adata (AnnData) – Annotated data object with computed eigenanalysis

  • cluster (str) – Cluster name

  • which (str, optional (default: 'max')) – Which eigenvalue: ‘max’ or ‘min’

  • n_genes (int, optional (default: 10)) – Number of top genes to annotate

  • cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels

  • color (str, optional) – Color for plot. If None, uses blue for ‘max’, red for ‘min’

  • annotate (bool, optional (default: True)) – Whether to annotate top genes

  • figsize (tuple, optional (default: (10, 5))) – Figure size

  • ax (plt.Axes, optional) – Axes to plot on

Returns:

Axes with plot

Return type:

plt.Axes