pegasus.wordcloud
- pegasus.wordcloud(data, factor, max_words=20, features='highly_variable_features', random_state=0, colormap='hsv', width=800, height=400, panel_size=(6, 4), return_fig=False, dpi=300.0, **kwargs)[source]
Generate one word cloud image for factor (starts from 0) in data.uns[‘W’].
- Parameters
data (
AnnDataorUnimodalDataorMultimodalDataobject) – The main data object.factor (
int) – Which factor to plot. factor starts from 0.max_words (
int, optional, default: 20) – Maximum number of genes to show in the image.features (
str, optional, default:highly_variable_features) – Features selected for NMF computation.random_state (
int, optional, default: 0) – Random seed passing to WordCloud function.colormap (
str, optional, default:hsv) – Color map for plotting words.width (
int, optional, default: 800) – Canvas width.height (
int, optional, default: 400) – Canvas height.panel_size (
tuple, optional, default: (6, 4)) – The plot size (width, height) in inches.return_fig (
bool, optional, default:False) – Return aFigureobject ifTrue; returnNoneotherwise.dpi (
float, optional, default:300.0) – The resolution in dots per inch.
- Return type
Optional[Figure]- Returns
Figure object – A
matplotlib.figure.Figureobject containing the dot plot ifreturn_fig == True
Examples
>>> fig = pg.wordcloud(data, factor=0)