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 | Mapping | None = None, symbol: str | Mapping | None = None, jitter_frac: float | None = 0.02, random_seed: int = 42, width: int | None = 900, height: int | None = 600, marker_size: int | float = 5, color_discrete_sequence: List | None = None, color_discrete_map: Mapping | None = None, category_orders: List | Mapping | None = None, legend_sizing: Literal['constant', 'trace'] = 'constant', 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 Mapping or None, optional

Name of variable to use to color the markers.

symbolstr or Mapping 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 or float, optional, default: 5

Marker size.

color_discrete_sequenceList or None, optional

Provide a list of colours to use.

color_discrete_mapMapping or None, optional

Provide an explicit mapping from values to colours.

category_ordersList or Mapping or None, optional

Control the order in which values appear in the legend.

legend_sizing{‘constant’, ‘trace’}, optional, default: ‘constant’

Determines if the legend items symbols scale with their corresponding “trace” attributes or remain “constant” independent of the symbol size on the graph.

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).