Skip to content
Prev 295427 / 398506 Next

barplot

Hello,

Would the following do it?



# make the dates vector
x <- seq(as.Date("2011-03-15"), as.Date("2011-09-09"), by="day")
# this is the important part
labs <- seq(min(x), max(x), by="month") # "month", not 30
labs <- format(labs, "%b")
labs.pos <- round(seq(1, length(x), length.out=length(labs)))

# make some abundance data
set.seed(1)
y <- rnorm(1e4)
y <- hist(y, breaks=seq(min(y) - 0.5, max(y) + 0.5, length.out=180),
plot=FALSE)$counts

df1 <- data.frame(datum=x, abundance=y)

barplot(df1$abundance, xaxt="n")
axis(1, at=labs.pos, labels=labs)


Hope this helps,

Rui Barradas

bets wrote
--
View this message in context: http://r.789695.n4.nabble.com/barplot-tp4631070p4631093.html
Sent from the R help mailing list archive at Nabble.com.