Draw angled ellipses around clusters on PCA plot
26 views (last 30 days)
Show older comments
I would like to draw angled ellipses around clusters in a PCA plot representing the 95% CI for this cluster, similar to what is done by autoplot in R (also, see attached example, or this link https://r-charts.com/correlation/scatter-plot-ellipses-ggplot2/). Any resources for how to do this in matlab, or the math behind how to do this would be much appreciated!
As a note: I did see a post on this forum where people drew ellipses in line with the axes where the height of the ellipse is the 95% CI in X and the width is the 95% CI in Y; this is NOT what I would like, I would like the ellipses at an angle that fits the shape of the clusters, as shown in my examples
0 Comments
Accepted Answer
More Answers (2)
Matt J
on 29 Nov 2023
Using polyshapes:
ellipse=rotate( scale(nsidedpoly(1000),[2,1]) ,30);
plot(ellipse)
0 Comments
See Also
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!