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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 24 18:10:49 CEST 2012


Author: weylandt
Date: 2012-07-24 18:10:49 +0200 (Tue, 24 Jul 2012)
New Revision: 691

Modified:
   pkg/xtsExtra/R/barplot.R
   pkg/xtsExtra/R/plot.R
Log:
Extend shading blocks further (bug report: K Russell)

Modified: pkg/xtsExtra/R/barplot.R
===================================================================
--- pkg/xtsExtra/R/barplot.R	2012-07-23 14:58:55 UTC (rev 690)
+++ pkg/xtsExtra/R/barplot.R	2012-07-24 16:10:49 UTC (rev 691)
@@ -63,7 +63,7 @@
     posn = barplot(t(x), plot = FALSE, space = space)
     for(i in seq_along(ep)) ep1[i] = posn[ep[i]] # Vectorize?
   } else {
-    posn = barplot(t(x), plot = FALSE, beside = TRUE) 
+    posn = barplot(t(x), plot = FALSE, beside = TRUE)
     # FIXME support space: space = c(0, space) ? 
     for(i in seq_along(ep)) ep1[i] = posn[2,ep[i]] # Vectorize?
   }

Modified: pkg/xtsExtra/R/plot.R
===================================================================
--- pkg/xtsExtra/R/plot.R	2012-07-23 14:58:55 UTC (rev 690)
+++ pkg/xtsExtra/R/plot.R	2012-07-24 16:10:49 UTC (rev 691)
@@ -356,8 +356,8 @@
 
 do_add.shading <- function(blocks, y){
   for(j in seq_along(blocks[["start.time"]])){
-    rect(as.POSIXct(get.elm.recycle(blocks[["start.time"]], j)), 0.5*min(y), 
-         as.POSIXct(get.elm.recycle(blocks[["end.time"]], j)), 1.5 * max(y),
+    rect(as.POSIXct(get.elm.recycle(blocks[["start.time"]], j)), min(0, -3*min(y), 3*min(y)), ## Dirty hack!
+         as.POSIXct(get.elm.recycle(blocks[["end.time"]], j)), max(0, 3*max(y), -3*max(y)), 
          col = if(!is.null(blocks[["col"]])) get.elm.recycle(blocks[["col"]],j) else "lightblue1",
          border = NA)
   }



More information about the Xts-commits mailing list