[Dplr-commits] r1098 - in pkg/dplR: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 22 22:47:49 CEST 2018


Author: andybunn
Date: 2018-05-22 22:47:49 +0200 (Tue, 22 May 2018)
New Revision: 1098

Modified:
   pkg/dplR/R/plotRings.R
   pkg/dplR/man/plotRings.Rd
Log:
more plot rings changes

Modified: pkg/dplR/R/plotRings.R
===================================================================
--- pkg/dplR/R/plotRings.R	2018-05-22 20:11:53 UTC (rev 1097)
+++ pkg/dplR/R/plotRings.R	2018-05-22 20:47:49 UTC (rev 1098)
@@ -111,7 +111,8 @@
               else if(x.rings == "none") cols) 
       
       # year labels
-      if(year.labels == TRUE) legend('topright', legend=year[i], bty="n", inset = 0.01, cex=2)
+      #if(year.labels == TRUE) legend('topright', legend=year[i], bty="n", inset = 0.01, cex=2)
+      if(year.labels == TRUE) title(sub=year[i])
       
       Sys.sleep(sys.sleep)
     }
@@ -136,7 +137,9 @@
              else if(x.rings == "none") cols)
     
     # year labels
-    if(year.labels == TRUE) legend('topright', legend=paste(range(year)[1], "-", range(year)[2]), bty="n", inset = 0.01, cex=1.2)
+    #if(year.labels == TRUE) legend('topright', legend=paste(range(year)[1], "-", range(year)[2]), bty="n", inset = 0.01, cex=1.2)
+    if(year.labels == TRUE) title(sub=paste(range(year)[1], "-", range(year)[2]))
+    
   }
   
   # saveGIF
@@ -166,10 +169,12 @@
                 else if(x.rings == "none") cols) 
         
         # year labels
-        if(year.labels == TRUE) legend('topright', legend=year[i], bty="n", inset = 0.01, cex=2)
+        #if(year.labels == TRUE) legend('topright', legend=year[i], bty="n", inset = 0.01, cex=2)
+        if(year.labels == TRUE) title(sub=year[i])
       }
-    }, movie.name = fname, interval = sys.sleep, nmax = 10, ani.width = 1000, 
-    ani.height = 1000)  
+      # AGB changed interval to delay which works under mac. Not sure about windows.
+    }, movie.name = fname, delay = sys.sleep, nmax = 10, 
+    ani.width = 1000, ani.height = 1000)
   }
   
   # Without saving the GIF
@@ -191,7 +196,8 @@
              else if(x.rings == "none") cols)
     
     # year labels
-    if(year.labels == TRUE) legend('topright', legend=paste(range(year)[1], "-", range(year)[2]), bty="n", inset = 0.01, cex=1.2)
+    #if(year.labels == TRUE) legend('topright', legend=paste(range(year)[1], "-", range(year)[2]), bty="n", inset = 0.01, cex=1.2)
+    if(year.labels == TRUE) title(sub=paste(range(year)[1], "-", range(year)[2]))
   }
   
   

Modified: pkg/dplR/man/plotRings.Rd
===================================================================
--- pkg/dplR/man/plotRings.Rd	2018-05-22 20:11:53 UTC (rev 1097)
+++ pkg/dplR/man/plotRings.Rd	2018-05-22 20:47:49 UTC (rev 1098)
@@ -145,11 +145,10 @@
 res <- plotRings(yrs, anos1[,4], trwW = anos1[,5],year.labels = TRUE, 
                  animation = TRUE, sys.sleep = 0.1)
                  
-# Plot Rings and save as GIF (requires ImageMagick)
+# Plot Rings and save as GIF (requires ImageMagick to be installed in PATH)
 library(animation)
-ani.options(convert = 'C:/PROGRA~1/ImageMagick-7.0.7-Q16/magick.exe')
 res <- plotRings(yrs, anos1[,4], trwW = anos1[,5],
-                 saveGIF = TRUE, sys.sleep = 0.1)
+                 saveGIF = TRUE, fname="GIF_plotRings.gif")
 }
 
 # with four fake tree-ring series 



More information about the Dplr-commits mailing list