0

I used

biplot(prcomp(data, scale.=T), xlabs=rep("·", nrow(data)))

but it did not work to omit the labels. Even if I remove the labels my plot is so messy and ugly which can be seen below! I also need to show the percentage of PCs on axes enter image description here

I used the following command to plot the image

biplot(prcomp(data, scale.=T), xlabs=rep("·", nrow(data)), ylabs = rep("·", ncol(data)))
Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
  • 1
    Your question is not [`reproducible`](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). But your approach should work ex. `biplot(prcomp(USArrests, scale.=T), xlabs=rep("·", nrow(USArrests)))` – user20650 Feb 09 '15 at 16:13
  • Are you trying to get rid of the `ylabs` as well? Then just use `biplot(princomp(USArrests, scales=TRUE), xlabs = rep("·", nrow(USArrests)), ylabs = rep(".", ncol(USArrests)) )` – shadow Feb 09 '15 at 16:30
  • unfortunately I cannot publish my data but I just want to get rid of labels since my data is huge , look at the above plot even if I remove the labels it becomes so ugly –  Feb 09 '15 at 17:25
  • [Here are a few tips](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) on how to reproduce your problem. If there's too much data, you can always simulate some and pass on the code for that. – Roman Luštrik Feb 12 '15 at 12:31

1 Answers1

1

Try this one

\devtools::install_github("sinhrks/ggfortify")
library(ggfortify)
ggplot2::autoplot(stats::prcomp(USArrests, scale=TRUE), label = FALSE, loadings.label = TRUE)

enter image description here

MYaseen208
  • 22,666
  • 37
  • 165
  • 309
  • thanks for your nice comment. my data is huge and this make it so ugly ! does not show the precentage of PCs on plot neither ! –  Feb 09 '15 at 17:24