title: LDA contribution biplot
body: <p>I am trying to create a biplot for a linear discriminate analysis (LDA). I am using a modified version of code obtained from here <a href="https://stats.stackexchange.com/questions/82497/can-the-scaling-values-in-a-linear-discriminant-analysis-lda-be-used-to-plot-e">https://stats.stackexchange.com/questions/82497/can-the-scaling-values-in-a-linear-discriminant-analysis-lda-be-used-to-plot-e</a></p>
  
  <p>However, I have 80 variables, making the biplot extremely difficult to read. This is worsened by highly contributing variables, since their arrow lengths are very long and the remaining labels are scrunched up in the middle.
  So what I am trying to achieve is a biplot where all variable arrows are of equal length, and their relative contributions (scalings) are distinguished by graded colours.
  So far I have managed to get the graded colours, but I can't find a way to make the arrow lengths the same. From what I understand, <code>geom_text</code> and <code>geom_segment</code> uses the LD1 and LD2 values to determine both the <strong>length</strong> and <strong>direction</strong> of the arrows. How can I override the length?</p>
  
  <p><a href="https://i.stack.imgur.com/tRF9U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tRF9U.png" alt="enter image description here"></a></p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>library(ggplot2)
  library(grid)
  library(MASS)
  data(iris)
  
  
  iris.lda &lt;- lda(as.factor(Species)~.,
                  data=iris)
  
  #Project data on linear discriminants
  iris.lda.values &lt;- predict(iris.lda, iris[,-5])
  
  #Extract scaling for each predictor and
  data.lda &lt;- data.frame(varnames=rownames(coef(iris.lda)), coef(iris.lda))
  
  #coef(iris.lda) is equivalent to iris.lda$scaling
  
  data.lda$length &lt;- with(data.lda, sqrt(LD1^2+LD2^2))
  
  #Plot the results
  p &lt;- qplot(data=data.frame(iris.lda.values$x),
             main="LDA",
             x=LD1,
             y=LD2,
             colour=iris$Species)+stat_ellipse(geom="polygon", alpha=.3, aes(fill=iris$Species))
  p &lt;- p + geom_hline(aes(yintercept=0), size=.2) + geom_vline(aes(xintercept=0), size=.2)
  p &lt;- p + theme(legend.position="right")
  p &lt;- p + geom_text(data=data.lda,
                     aes(x=LD1, y=LD2,
                         label=varnames, 
                         shape=NULL, linetype=NULL,
                         alpha=length, position="identity"),
                     size = 4, vjust=.5,
                     hjust=0, color="red")
  p &lt;- p + geom_segment(data=data.lda,
                        aes(x=0, y=0,
                            xend=LD1, yend=LD2,
                            shape=NULL, linetype=NULL,
                            alpha=length),
                        arrow=arrow(length=unit(0.1,"mm")),
                        color="red")
  p &lt;- p + coord_flip()
  
  print(p)
  </code></pre>