malariagen_data.ag3.Ag3.plot_pca_coords_3d#
- Ag3.plot_pca_coords_3d(data: DataFrame, x: str = 'PC1', y: str = 'PC2', z: str = 'PC3', 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 = 5, show: bool = True, renderer: str | None = None, **kwargs) Figure | None #
Plot sample coordinates from a principal components analysis (PCA) as a plotly 3D 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.
- zstr, optional, default: ‘PC3’
Name of variable to plot on the Z 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: 5
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_3d().
Returns#
- Figure or None
A plotly figure (only returned if show=False).