On Mon, 30 Apr 2001, Marco Taboga wrote:
I am trying to plot a time series (a stock index) with dates on the
x-axis. If I type: plot(a,b) where a is the vector of dates obtained
with chron() and b is the time series, I get a nice plot. If I type:
plot(a,b,type="l") to obtain the same plot with a continuous line
instead of dots, I get the plot of the time series, but the graph is
all scattered with numbers (thousands of numbers everywhere!). What is
wrong? Is there a better way to get plots with dates on the x-axis?
Thank you.
The lines are joined in the order than the points are plotted. This is the
order in the dataset, not the order of the x variable.
One possibility is
oo<-order[a]
plot(a[oo],b[oo],type="l")
-thomas
Thomas Lumley Asst. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle