1

I've successfully produced NMDS plots (monoMDS, bray-curtis, 3 dimensions, local model). Each point represents an animal and their diet composition.

I have two questions:

(1) how do I change the symbology of points to show 2 levels (a or j) within 1 column (Life stage) on the NMDS plot?!

(2) How should I show 3D NMDS, I can't get the 3D orgl- functions to work on the 3D plot. Should I just make a few plots showing different dimensions in 2D? Looking for thoughtful ideas.

The code used:

    plot((BC.NMDS.length.corr), choices = c(1, 2), type = "points",
          xlim = c(-2.0, 2.0),las = 1, ylim = c(-1, 1), 
          xlab = "NMDS Axis 1", ylab = "NMDS Axis 2",mgp = c(3.25, 1, 0), 
          cex.lab = 1.35, cex.axis = 1.25)

    with(DATA, 
         points(BC.NMDS.length.corr, Class, draw = "points",col = "gray0", 
                show.groups = "Adult",label = TRUE, lty = 1, lwd = 2))
ecology
  • 606
  • 3
  • 9
  • 29
  • 1
    Hi and welcome! Can you please write an example of the code you are using? This will provide us more information and it would be easier for us to help you! – R18 May 08 '17 at 12:27

1 Answers1

2

Using an example of what you want with the default example of the package:

     # Load library
       library(vegan)
     # Load data
       data(dune)
     # Compute the distance
       dis <- vegdist(dune)

Specify if you want a 3D plot, the representation of the three dimensions

     # Run monoMDS
       m <- monoMDS(dis, model = "loc", k=3)

     # The 3D representation
       plot(m)
     # Load library for 3D representation
       library(scatterplot3d)

Coordinates are in m$points; each column referring to each dimension.

     # Graphical representation
       scatterplot3d(x=m$points[,1], y=m$points[,2], z=m$points[,3])

Additionally, if you want to colour the plots depending on a factor, you can specify color=A, where A is a numeric value where groups are codified.

R18
  • 1,476
  • 1
  • 8
  • 17
  • So, you are interested in colour your individuals by `site`. For this `scatterplot3d(x=m$points[,1], y=m$points[,2], z=m$points[,3], col = factor(site, labels=c(1,2,3)))` – R18 May 08 '17 at 14:39
  • 2
    You should set `asp = 1` (requires **scatterplot3d** version 0.3-40) in ordination plots. Alternatively, you can use **vegan3d** package and `ordiplot3d()` function that takes automatically care of many things, including the aspect ratio and reading ordination result objects. – Jari Oksanen May 09 '17 at 06:33