From maechler at stat.math.ethz.ch  Sat Nov 24 14:45:22 2007
From: maechler at stat.math.ethz.ch (Martin Maechler)
Date: Sat, 24 Nov 2007 14:45:22 +0100
Subject: [Rd] patch proposal for plot.ts
In-Reply-To: <b0808fdc0711240335h373aa3aaq34f70604df89dd9a@mail.gmail.com>
References: <b0808fdc0711240335h373aa3aaq34f70604df89dd9a@mail.gmail.com>
Message-ID: <18248.10994.493021.230803@ada-stat.math.ethz.ch>

>>>>> Antonio, Fabio Di Narzo <antonio.fabio at gmail.com>
>>>>>     on Sat, 24 Nov 2007 12:35:25 +0100 writes:

    > 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. 

I agree, It seems pretty clear to you have uncovered a -
somewaht rarely tirggered bug there...

    > 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)
		 if(xy.lines)
		     lines(xy, col = col, lty = lty, lwd = lwd,

>      Best regards,
>      Antonio.

Thank you very much, Antonio, for the nice compact report and
patch!

This will be fixed in R 2.7.0 and maybe even in 2.6.1

Martin Maechler, ETH Zurich



[Rd] patch proposal for plot.ts
Martin Maechler