Skip to content
Prev 131663 / 398502 Next

Setting the grid of a graph of timeseries

- You don't need a panel function since there is only one.
- There should not be more than 2 components on lty and lwd
since tab has two columns and that is the cause of the
warning message you are seeing.
- with the recent version of zoo plot.type uses screen so
you can write the shorter screen = 1 instead of the lengthier
plot.type = "single"

Redone with an abline at the end to give the grid lines gives:

plot(tab, screen = 1, lty = c(1,2), lwd = c(8,2),
	col = c("darkorange", "red2"),
	xlab = " ", ylab = "euro/MWh", xaxt = "n")

fmt <- "%b-%Y" # format for axis labels
axis(1, at = time(tab), lab = FALSE)
ix <- seq(1, length(tab), 3)
labs <- format(time(tab), fmt)
axis(1, at = time(tab)[ix], lab = labs[ix], tcl = -0.7, cex.axis = 0.9)
abline(v = time(tab)[ix], lty = 2, col = "grey")
On Dec 9, 2007 12:33 PM, vittorio <vdemart1 at tin.it> wrote: