0

Ordiellipse plot, part of ellipses are shown in bottom left corner, no other information is shown

I am trying to create an NMDS plot with bee species data grouped by the presence/absence of mines. In the following line of code beematrix=species abundances by site and beesmine= defines which sites contain mined areas.

beematrix=read.csv(file.choose(), row.names = 1)
beesmine=read.csv(file.choose(), row.names = 1)
beesmatrix=as.matrix(beematrix)
beematrix=t(beesmatrix)
library(vegan)
rankindex(beematrix, beematrix)
bees.nmds=metaMDS(beematrix, distance = "kulczynski")
for (i in 1:5) print (metaMDS(beesmatrix, distance = "kulczynski", k=i, trace = FALSE)$stress*100)
bees.nmds=metaMDS(beesmatrix, distance = "kulczynski", k=3)
plot(bees.nmds)
plot.new()
ordiellipse(bees.nmds, groups=beesmine$Mine,label = TRUE)
##ordiellipse is smushed into corner of screen and is impossible to read

1 Answers1

1

Do not use plot.new: it destroys the previous plot and faults ordiellipse. Function ordiellipse will add ellipses to an existing ordination plot, but you have no existing plot after you used plot.new() which destroys all that exist.

What led you to use plot.new()?

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15
  • I had an error message earlier that asked me to call plot.new(). I just tried running it again without it and it works great. Thank you. – Amanda Dunaway Jun 17 '18 at 20:33
  • Yes, you must first `plot` the ordination result (as `plot(bees.nmds)`), and then you can add ellipses with `ordiellipse()`. If you have not plotted the ordination result, you get an error message that you must plot it first, and this message asks you to "call plot.new" (*i.e.*, to use `plot(bees.nmds)`). – Jari Oksanen Jun 18 '18 at 04:53