[Xts-commits] r675 - pkg/xtsExtra/R
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jul 12 01:01:23 CEST 2012
Author: weylandt
Date: 2012-07-12 01:01:23 +0200 (Thu, 12 Jul 2012)
New Revision: 675
Modified:
pkg/xtsExtra/R/plot.R
Log:
Partial (complete?) fix to ylab.loc = 'flip' margins
Modified: pkg/xtsExtra/R/plot.R
===================================================================
--- pkg/xtsExtra/R/plot.R 2012-07-11 22:30:50 UTC (rev 674)
+++ pkg/xtsExtra/R/plot.R 2012-07-11 23:01:23 UTC (rev 675)
@@ -146,7 +146,8 @@
do_add.grid(x.plot, major.ticks, major.format, minor.ticks,
auto.grid = auto.grid, ylab = ylab.panel, log = log.panel,
have_x_axis = have_x_axis[i], have_y_axis = have_y_axis[i],
- ylab.axis = ylab.axis[i], events = events, blocks = blocks)
+ ylab.axis = ylab.axis[i], events = events, blocks = blocks,
+ ylab.loc = ylab.loc)
col.panel <- get.elm.from.dots("col", dots, screens, i)
@@ -276,14 +277,18 @@
do_add.grid <- function(x, major.ticks, major.format, minor.ticks, axes,
auto.grid, xlab, ylab, log, have_x_axis, have_y_axis,
- ylab.axis, events, blocks, ...){
+ ylab.axis, events, blocks, ylab.loc, ...){
# Set Margins for each panel here!
- par(mar = have_x_axis*c(3.4,0,0,0) + switch(ylab.axis,
- none = c(0,0,0,0),
- left = c(0, 4.5, 0, 1.5),
- right = c(0, 1.5, 0, 4.5)))
-
+ if(ylab.loc == "flip"){
+ par(mar = have_x_axis*c(3.4, 0, 0, 0) + c(0, 4.5, 0, 4.5))
+ } else {
+ par(mar = have_x_axis*c(3.4,0,0,0) +
+ switch(ylab.axis,
+ none = c(0,0,0,0),
+ left = c(0, 4.5, 0, 1.5),
+ right = c(0, 1.5, 0, 4.5)))
+ }
# Plotting Defaults
if(missing(axes)) axes <- TRUE
if(missing(ylab)) ylab <- ''
More information about the Xts-commits
mailing list