Control the appearance of a biplot by specifying supported line property names and values, and by using handles to the graphics objects created by biplot.
Load the sample data.
load carsmall
Create a matrix consisting of the variables Acceleration, Displacement, and MPG. Delete rows in the matrix that have missing values.
X = [Acceleration Displacement MPG];
X = rmmissing(X);
Standardize X and perform a principal component analysis.
Z = zscore(X); % Standardized data
[coefs,score] = pca(Z);
The 3-by-3 matrix coefs contains the principal component coefficients (one column for each principal component). The matrix score contains the principal component scores (the observations).
Create a biplot of the observations in the space of the first two principal components. Use the default properties for the biplot.
h = biplot(coefs(:,1:2),'