Skip to content

two zoo questions

3 messages · michal miklovic, Gabor Grothendieck, Achim Zeileis

#
On Fri, May 9, 2008 at 8:21 AM, michal miklovic <mmiklovic at yahoo.com> wrote:
By "empty segments" do you mean you just want to plot the data
against 1, 2, 3, ... and then label successive times as
format(time(ShorterSpan), "...") on the X axis?

If that is it then try this:

s <- zoo(coredata(ShorterSpan))
plot(s, screens = 1, type = "p", col = 1:3, xaxt = "n")
axis(1, time(s), format(time(ShorterSpan), "%m-%d"), cex.axis = 0.5)
#
On Fri, 9 May 2008, michal miklovic wrote:

            
Gabor explained why this happens. When you do a scatter plot of
  plot(c(1, 2, 4), rnorm(3))
There is also 3 in the range of the x-axis although there are no
observations for this.
I still don't understand what empty segments really means. But I have the
suspsicion you want something like:
  plot(1:nrow(ShorterSpan), ShorterSpan[,1], xaxt = "n")
  axis(1, at = 1:nrow(ShorterSpan),
    labels = format(time(ShorterSpan), "%d %b %Y"))
which is not really a time series plot...

hth,
Z