make 3d PCA plot

I often use PCA(principal component analysis) to reduce dimension.
I do PCA using Python sklearn or R language.

Basic function of R “biplot” makes 2D chart.
It’s easy way to make biplot.

Today I found cool library of R, named “pca3d”.
Install is easy! Just type following command.


Now make chart.
I used iris data set for test.

> library(pca3d)
> data(iris)
> pca <- prcomp(iris[,-5], scale.=TRUE)
> pca3d(pca, group=iris[,5], biplot=TRUE)
[1] 0.06599283 0.05354630 0.02004088
Creating new device

Enter pca3d command, X quarts was launched and I got 3d biplot.
The chart can move.
Screen Shot 2015-10-23 at 11.07.58 PM

Hmm, 3D chart is useful to check the distribution of datapoint, but… I like 2D biplot. ;-)

If reader who is interested in the library, please check following site.

Click to access pca3d.pdf

Published by iwatobipen

I'm medicinal chemist in mid size of pharmaceutical company. I love chemoinfo, cording, organic synthesis, my family.

One thought on “make 3d PCA plot

  1. This is very useful as a clustering validation/representation technique, but I think that’s it

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: