[Vegan-commits] r889 - pkg/vegan/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jul 9 16:58:47 CEST 2009


Author: jarioksa
Date: 2009-07-09 16:58:43 +0200 (Thu, 09 Jul 2009)
New Revision: 889

Modified:
   pkg/vegan/R/postMDS.R
Log:
postMDS halfchange plot uses numeric colours to allow setting a palette

Modified: pkg/vegan/R/postMDS.R
===================================================================
--- pkg/vegan/R/postMDS.R	2009-07-05 13:31:40 UTC (rev 888)
+++ pkg/vegan/R/postMDS.R	2009-07-09 14:58:43 UTC (rev 889)
@@ -51,21 +51,22 @@
         drange <- range(c(dist, 0, 1))
         plot(orange, drange, type = "n", xlab = "Ordination distance", 
              ylab = "Community dissimilarity")
-        points(ordi[take], dist[take], pch = pch, col = "blue")
-        points(ordi[!take], dist[!take], pch = pch, col = "gray")
+        ## Colours in default palette: 2 = red, 4 = blue, 8 = gray.
+        points(ordi[take], dist[take], pch = pch, col = 4)
+        points(ordi[!take], dist[!take], pch = pch, col = 8)
         abline(h = threshold)
         abline(h = k[1])
         hclevel <- (1 - k[1])/2 + k[1]
-        segments(0, hclevel, hc, hclevel, col = "red", lwd = 2)
-        arrows(hc, hclevel, hc, 0, col = "red", lwd = 2)
-        arrows(0, k[1], 0, hclevel, col = "red", code = 3)
-        arrows(0, hclevel, 0, 1, col = "red", code = 3)
+        segments(0, hclevel, hc, hclevel, col = 2, lwd = 2)
+        arrows(hc, hclevel, hc, 0, col = 2, lwd = 2)
+        arrows(0, k[1], 0, hclevel, col = 2, code = 3)
+        arrows(0, hclevel, 0, 1, col = 2, code = 3)
         j <- 0.02
         text(0 + j, threshold + j, "Threshold", adj = c(0, 0))
         text(0 + j, k[1] + j, "Replicate dissimilarity", adj = c(0, 
                                                          0))
         text(0 + j, hclevel + j, "Half-change", adj = c(0, 0))
-        abline(k, col = "blue", lwd = 2)
+        abline(k, col = 4, lwd = 2)
     }
     attr(x, "centre") <- center
     attr(x, "pc") <- pc



More information about the Vegan-commits mailing list