[R] cannot add lines to plot

Zeno Adams zeno.adams at vwl.uni-freiburg.de
Tue Aug 7 10:39:07 CEST 2007


Hello,

I want to plot a time series and add lines to the plot later on.
However, this seems to work only as long as I plot the series against
the default index. As soon as I plot against an object
of class chron or POSIXt (i.e. I want to add a date/time axis), the
lines do not appear anymore. The command to add the lines is executed
without an error message.

(THIS DOES NOT ADD THE LINES)
plot(datum2[(3653):(3653+i)],dlindus[(3653):(3653+i)], col
=hcl(h=60,c=35,l=60), ylim=c(-8,8), type = "l", xlab=(""),
ylab=("Return"), main = ("Industry"))
lines(gvarindus, type="l", lwd=2)
lines(quantindustlow, col ="black", type = "l",lty=3)
lines(quantindusthigh, col ="black", type = "l",lty=3)

(THIS ADDS THE LINES, but then I dont have an date axis)
 plot(dlindus[(3653):(3653+i)], col =hcl(h=60,c=35,l=60), ylim=c(-8,8),
type = "l", xlab=(""), ylab=("Return"), main = ("Industry"))
lines(gvarindus, type="l", lwd=2)
lines(quantindustlow, col ="black", type = "l",lty=3)
lines(quantindusthigh, col ="black", type = "l",lty=3)

This sounds like a fairly simple problem, but I cannot find any answer
in the R-help archives.

Thanks alot.

Zeno



More information about the R-help mailing list