Hi,
I'm trying to create a visual demonstration of how Principle Components
Analysis works in projecting two-dimensional data into one dimension.
So I have created some 2D datapoints which lie along a diagonal line,
with some Gaussian noise thrown in.
Using PCA I can determine the vectors of the principle components. Then
I want to plot lines for those vectors, which should bisect one another
on the diagram. First question: I'd like those lines to have arrowheads
on each end (so that they look like axes). How can I achieve this?
Second question: I can create a second 2D dataset which is the
projection of the original datapoints onto the principle component, so
that they all lie on the line of the principle component. I would like
to draw dotted or dashed lines between each original datapoint and its
new position. It's not clear to me how I would best achieve this. Can
anyone give me any advice?
Many thanks,
Hamish
|