简体   繁体   中英

How to change font size of species labels in vegan's biplot() function

I am trying to create a series of publishable biplots of a PCA on insect abundance in different strata (tree canopy and understory) of forests. I am doing this using the rda() function. To create the plot, I am using vegan's biplot() function and do a couple of modifications to it:

Family=read.table("Family2.txt", header=T)
strata=read.table("Strata.txt", header=T)

family.pca=rda(Family)

with(strata, levels(Strata))

biplot(family.pca, type=c("text", "none"), col=c("black", "black"), xlab="", 
ylab="")
title(xlab="PC1 (86.8%)", ylab="PC2 (9.7%)", mgp=c(2.2, 2.2, 0))
points=c(16, 1)
colour=c("black", "black")
with(strata, points(family.pca, display = "sites", col = colour, pch = 
points))
with(strata, legend("topright", legend = levels(Strata), bty = "n", col = 
colour, pch = points, pt.bg = points))

The result is quite nice:

在此处输入图片说明

But because I will join several biplots to a bigger graph, the labels for the families (usually called 'species labels') are too small. I tried to change them using cex=1.5 in biplot() , but it seems to get overwritten by the defaults of the function. When I create an empty biplot frame by setting type=c("none", "none") , I can add bigger species labels using the text() function, eg

text(family.pca, display = "species", cex = 1.0, col = "black")

but then I don't know how to add the arrows to the plot (I would really like to have the arrows in there...).

Does anybody know of a solution for this case? Answers are greatly appreciated.

I recommend going to ?biplot you should see an explanation for the argument cex in the documentation. That should help you as it related to the labels of the plot and the size of these labels.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM