# Plotting a discriminant as line on scatterplot

Given a data scatterplot I can plot the data's principal components on it, as axes tiled with points which are principal components scores. You can see an example plot with the cloud (consisting of 2 clusters) and its first principle component. It is drawn easily: raw component scores are computed as data-matrix x eigenvector(s); coordinate of each score point on the original axis (V1 or V2) is score x cos-between-the-axis-and-the-component (which is the element of the eigenvector). My question: Is it possible somehow to draw a discriminant in a similar fashion? Look at my pic please. I'd like to plot now the discriminant between two clusters, as a line tiled with discriminant scores (after discriminant analysis) as points. If yes, what could be the algo? • It might be easier to think of this as a projection: $U(1)$ in both cases (PCA or LDA) is a unit vector in the direction on which you want to project your data (first principle axis, or first "discriminant axis"). Orthogonal projector is given by $P_U = UU^\top$. So the answer is $XUU^\top$ (which of course is exactly what you found out yourself). The same formula works for higher dimensions as well. – amoeba says Reinstate Monica Jan 25 '14 at 13:45
• Yes, sure $XV$ are coordinates of the data points in the target space of lower dimensionality, but if you want to get the image of the projection in the original high-dimensional space (i.e. green dots on your scatter plots in this thread), you project these points back with $V^+$, so in the end you get $XVV^+$. I made a mistake in my previous comment: it reduces to $XVV^\top$ only when $V$ has orthonormal columns, like in the PCA case (but not LDA). Of course if you only consider 1 axis (and so $V$ has only 1 column), then it does not matter. – amoeba says Reinstate Monica Jan 26 '14 at 0:23