depictr.pca_plot#
- depictr.pca_plot(data, cols=None, group=None, title=None)#
PCA biplot: observations on the first two components, with loading arrows.
Observations are scored on PC1 and PC2 and shown as points, optionally coloured by
group. Each original variable is drawn as an arrow from the origin in the direction of its loading, labelled with the variable name. The axis labels report the percentage of variance each component explains.- Parameters:
data (pandas.DataFrame) – The data.
cols (list of str, optional) – Numeric columns to decompose; defaults to all numeric columns.
group (str, optional) – A column mapped to the colour of the observation points. Kept aside from the decomposition, which uses only the numeric
cols.title (str, optional) – Plot title.
- Return type:
plotnine.ggplot