[Xts-commits] r724 - pkg/xtsExtra/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 19 08:18:18 CEST 2012


Author: weylandt
Date: 2012-08-19 08:18:17 +0200 (Sun, 19 Aug 2012)
New Revision: 724

Modified:
   pkg/xtsExtra/R/plot.R
Log:
Fix for 723 which respects the docs

Modified: pkg/xtsExtra/R/plot.R
===================================================================
--- pkg/xtsExtra/R/plot.R	2012-08-19 05:52:19 UTC (rev 723)
+++ pkg/xtsExtra/R/plot.R	2012-08-19 06:18:17 UTC (rev 724)
@@ -120,6 +120,18 @@
     
     x.split <- split.xts.by.cols(x, screens)
     
+    # Set panelwise parameters here 
+    ylab <- dots[["ylab"]] 
+    if(is.null(ylab)) {
+      if(is.null(names(x)))
+        ylab <- ""
+      else
+        ylab <- split(names(x), screens)
+    }
+    
+    log <- dots[["log"]]
+    if(is.null(log)) log <- ""
+    
     if(auto.legend) legend.names <- split(legend.names, screens)
     
     # For now, loop over screens one by one constructing relevant elements
@@ -133,13 +145,9 @@
       type.panel <- get.elm.from.dots("type", dots, screens, i)
       lty.panel  <- get.elm.from.dots("lty",  dots, screens, i)
       
-      # Set these defaults here
-      ylab.panel <- get.elm.from.dots("ylab", dots, screens, i)[[1L]]
-      if(is.null(ylab.panel)) ylab.panel <- if(!is.null(colnames(x.plot)[[1L]])) colnames(x.plot)[[1L]] else ""
+      log.panel <- get.elm.recycle(log, i)[[1L]]
+      ylab.panel <- get.elm.recycle(ylab, i)[[1L]]
       
-      log.panel <- get.elm.from.dots("log", dots, screens, i)
-      if(is.null(log.panel)) log.panel <- ""
-      
       panel.panel <- match.fun(if(length(panel) > 1L) get.elm.recycle(panel, i) else panel)
       
       # Note that do_add.grid also sets up axes and what not



More information about the Xts-commits mailing list