malariagen_data.af1.Af1.plot_pca_coords#

Af1.plot_pca_coords(data: DataFrame, x: str = 'PC1', y: str = 'PC2', color: str | None = None, symbol: str | None = None, jitter_frac: float | None = 0.02, random_seed: int = 42, width: int | None = 900, height: int | None = 600, marker_size: int = 10, show: bool = True, renderer: str | None = None, **kwargs) Figure | None#

Plot sample coordinates from a principal components analysis (PCA) as a plotly scatter plot.

Parameters#

dataDataFrame

A dataframe of sample metadata, with columns “PC1”, “PC2”, “PC3”, etc., added.

xstr, optional, default: ‘PC1’

Name of variable to plot on the X axis.

ystr, optional, default: ‘PC2’

Name of variable to plot on the Y axis.

colorstr or None, optional

Name of variable to use to color the markers.

symbolstr or None, optional

Name of the variable to use to choose marker symbols.

jitter_fracfloat or None, optional, default: 0.02

Randomly jitter points by this fraction of their range.

random_seedint, optional, default: 42

Random seed used for reproducible down-sampling.

widthint or None, optional, default: 900

Plot width in pixels (px).

heightint or None, optional, default: 600

Plot height in pixels (px).

marker_sizeint, optional, default: 10

Marker size.

showbool, optional, default: True

If true, show the plot. If False, do not show the plot, but return the figure.

rendererstr or None, optional

The name of the renderer to use.

**kwargs

Passed through to px.scatter().

Returns#

Figure or None

A plotly figure (only returned if show=False).