Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggbiplot size between vectors #63

Open
hiyamgh opened this issue Jun 19, 2020 · 2 comments
Open

ggbiplot size between vectors #63

hiyamgh opened this issue Jun 19, 2020 · 2 comments

Comments

@hiyamgh
Copy link

hiyamgh commented Jun 19, 2020

I have plot that is produced as follows:
pca_pure

How can I add some space between the vectors ? I want larger angles between them because they are not apparent

This is my code:

ggbiplot(df.pca,  obs.scale = 1, var.scale = 1,
  alpha=0) + 
  ggtitle("PCA")+
  theme_minimal()+
  theme(legend.position = "bottom") 
@hiyamgh
Copy link
Author

hiyamgh commented Jun 19, 2020

Update

I only made the plot somehow looking better by:

  • making the font size of the variables bigger using varname.size
  • increasing the distance between the vector and the label of the column name using varname.adjust

pca_pure

This looks somewhat better, but I will not close the issue as my problem is not solved completely

My code now:

ggbiplot(df.pca,
  alpha=0, varname.size = 4, varname.adjust=5) + 
  ggtitle("PCA")+
  theme_minimal()+
  theme(legend.position = "bottom") 

@bneises
Copy link

bneises commented Jun 26, 2020

@hiyamgh I don't have an answer for you, but you may have better luck using the latest maintained fork of this function: AMR::ggplot_pca() or using this (older) fork that uses ggrepel to add the text: https://github.com/tpq/ggbiplot

That last one is also nice for only printing a subset of the labels if that would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants