s-news
[Top] [All Lists]

[S] Days of week as tick labels

To: <s-news@wubios.wustl.edu>
Subject: [S] Days of week as tick labels
From: "Allan Reiffman" <allanr@gurunet.com>
Date: Sun, 28 May 2000 18:17:16 +0300
Importance: Normal
Sender: owner-s-news@wubios.wustl.edu

Sorry to bother with what is probably an easy task, but I've been knocking
my head against the wall on this one!

I'm trying to create a simple line-plot of a vector of data, where each row
is associated with a calendar date. What I would like is for the x-axis tick
labels to show the day-of-the week values e.g., Sunday, Monday. Tuesday,
etc...

I can get the weekday values ok, using the weekday() function, but these
values will not work as input to either plot() or xyplot() - looks like the
function expects numeric values.

Using ts.plot() almost works (after creating a cts object) but the labels
are the dates themselves, not the days of the week. I thought about
modifying the ts.plot() function but it looked kinda hairy...

The closest I've come is by doing a plot.factor() with a character="x"
option. This gives a plot of the data points and I guess I could overlay a
line plot on top of this, but I keep thinking that there MUST be an easier
way!

thank in advance,

- Allan

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>