[Rd] patch proposal for plot.ts

Antonio, Fabio Di Narzo antonio.fabio at gmail.com
Sat Nov 24 12:35:25 CET 2007

Hi all.
Currently, if you try:

> lag.plot(1:10)

you get superposed labels '1' and '10'. Things go worse in more extreme cases:

x <- ts(1:10)
x1 <- lag(x, 4)
plot(x1, x)

This is due to a mistake in plot.ts. My suggestion is the following
really minimal patch to plot.ts:

@@ -530,7 +530,7 @@ plot.ts <-
                text(xy, labels =
                     if(is.character(xy.labels)) xy.labels
                     else if(all(tsp(x) == tsp(y))) formatC(time(x), width = 1)
-                    else seq_along(x),
+                    else seq_along(xy$x),
                     col = col, cex = cex)
                lines(xy, col = col, lty = lty, lwd = lwd,

Best regards,

Antonio, Fabio Di Narzo
Ph.D. student at
Department of Statistical Sciences
University of Bologna, Italy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.ts.patch
Type: text/x-patch
Size: 473 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-devel/attachments/20071124/7ef12719/attachment.bin 

More information about the R-devel mailing list