[R-SIG-Finance] Plot.zoo does not take vector parameter for lwd

Sean Carmody seancarmody at gmail.com
Thu Jul 23 23:17:37 CEST 2009


It seems to me that plot.zoo does not treat the linewidth (lwd)
parameter as a vector and instead only uses the first value. Consider
the following example:

x <- zoo(data.frame(X=runif(12), Y=rnorm(12),
x=runif(12)),as.Date(paste("2009",1:12,1,sep="-")))
plot(x, plot.type="single", lwd=c(1,2,3))

The resulting plot has lines all of the same width. In contrast, the
col argument work as expected, for example:

plot(x,plot.type="single", col=rainbow(3))

Is there any way to get around this without plotting each line separately?

On a related subject, I found this post
http://tolstoy.newcastle.edu.au/R/e6/help/09/01/1297.html which
explains how to change the plot.zoo so that no bounding box is drawn.
It would seem a lot easier if plot.zoo would actually use a bty
argument that is passed. Is there any reason why this is not possible?

Regards,
Sean Carmody.



More information about the R-SIG-Finance mailing list