Skip to content
Prev 279577 / 398506 Next

Plotting Time Series Data by Month

Your data set is not reproducible from an image (use dput() on your
next post to give us a taste of your data) but I'll hazard it's a ts
class object. If so, try this:

X <- ts( sample(500, 204), frequency = 12, start = 1995)

plot( rep(1:12, 17), X, col = rep(1:17, each = 12), xaxt = "n", xlab =
"Months", pch = 20)
axis(1, at = 1:12, label = month.abb, padj = 0)
legend("bottom", pch = 20, col = 1:17, label = 1995:2011, horiz = TRUE)

as a start. You can add the grid lines with (among others) the abline
function's h argument.

Michael
On Mon, Dec 5, 2011 at 5:58 PM, crazedruff <smoochie3002 at gmail.com> wrote: