From 3eccc5b59bb01e2937ee93a82d68e29f0615b185 Mon Sep 17 00:00:00 2001 From: Jette Reeg Date: Wed, 2 Feb 2022 10:40:54 +0100 Subject: [PATCH] added missing figure --- .../Scripts/(0) Analyse_landscapes.R | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Reeg_et_al_2021/Scripts/(0) Analyse_landscapes.R b/Reeg_et_al_2021/Scripts/(0) Analyse_landscapes.R index 24951ae..ae0db42 100644 --- a/Reeg_et_al_2021/Scripts/(0) Analyse_landscapes.R +++ b/Reeg_et_al_2021/Scripts/(0) Analyse_landscapes.R @@ -13,6 +13,7 @@ require(ggplot2) require(ggthemes) require(data.table) +require(factoextra) require(FactoMineR) require(RColorBrewer) require(pca3d) @@ -92,6 +93,25 @@ col pca3d(res.pca3d, group=gr, col=col) snapshotPCA3d(file="FigB1.png") +# Figure B2 +brewer.pal(n = 4, name = "Dark2") + +plot.PCA <- fviz_pca_biplot(res.pca, + axes=c(1,2), + geom.ind = "point", # show points only (nbut not "text") + col.ind = factor(parameters$Cluster), # color by groups + palette = c("grey95", brewer.pal(n = 4, name = "Dark2")), + ggtheme = theme_few(), + repel=T, + addEllipses = FALSE, # Concentration ellipses + legend.title = "Landscape\ncluster", + title = "" +) + +jpeg("Fig_B2.jpeg", width=140, height=140, units="mm", res=300) +plot.PCA +dev.off() + ##### # Figure B2