From 77f8144712574950a59fa2b8c2c75a4674be1a87 Mon Sep 17 00:00:00 2001 From: Ethan Smith <24379655+ethanbsmith@users.noreply.github.com> Date: Sun, 28 Jul 2024 13:01:33 -0600 Subject: [PATCH] removed condition apply input recycling in all scenarios --- R/plot.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/R/plot.R b/R/plot.R index 158947f..6a166b5 100644 --- a/R/plot.R +++ b/R/plot.R @@ -247,12 +247,10 @@ plot.xts <- function(x, legend.loc=NULL, extend.xaxis=FALSE){ - if (as.numeric(multi.panel) > 0){ - # allow color and line attributes for each panel in a multi.panel plot - if(length(lty) < ncol(x)) lty <- rep(lty, length.out = ncol(x)) - if(length(lwd) < ncol(x)) lwd <- rep(lwd, length.out = ncol(x)) - if(length(col) < ncol(x)) col <- rep(col, length.out = ncol(x)) - } + # recycle inputs + if(length(lty) < ncol(x)) lty <- rep(lty, length.out = ncol(x)) + if(length(lwd) < ncol(x)) lwd <- rep(lwd, length.out = ncol(x)) + if(length(col) < ncol(x)) col <- rep(col, length.out = ncol(x)) # Small multiples with multiple pages behavior occurs when multi.panel is # an integer. (i.e. multi.panel=2 means to iterate over the data in a step