I have a NMDS plot overlaid with PCA scores. I have 45 PCA vectors that are each an animal species.
The issue is that the labels of my arrows (animal names) overlap one another. I was wondering if there was a way I could make the graph interactive such that one could hover over one of the PCA vector (red arrow) to make the name of the animal appear?
Here is the code I used to produce the graph:
Show the sites on the NMDS solution
new.solved.NMDS<-metaMDS(new.solved, distance = "jaccard", k = 4, trymax = 2000, autotransform=FALSE)
plot.new.solved<-data.frame(new.solved.NMDS$points)
par(mar=c(3,3,2,5) ,mgp=c(1.8,0.75,0))
sites:
plot(plot.new.solved$MDS1, plot.new.solved$MDS2, pch=16, cex=1, col="black",xlab="NMDS1", ylab="NMDS2", cex.lab=1, cex.axis=1, main="", bty="L", mai=c(0,0,2,10),xlim=c(-1.5,1.3),ylim=c(-0.9,1))
PCA vectors (and not NMDS) overlaid onto the NMDS Calculates species vectors
fit <- envfit(new.solved.NMDS, new.solved, choices=c(1,2,3))
adds species vectors on NMDS plot
fit.plot=plot(fit,cex=1.3,col="red",xlim=c(-1.5,1.3),ylim=c(-1.2,1.2), xlab="NMDS1",ylab="NMDS2")