statquant
statquant

Reputation: 14360

How can I modify the x-labels on a barplot

I succeded I plotting the following barplot I would like to

How can I do this ?

> m = matrix(abs(rnorm(40)),20,2)
> set.seed(1)
> m = matrix(abs(rnorm(40)),20,2)
> rownames(m) = seq(as.Date('2011-01-01'),as.Date('2011-01-20'),by=1)
> barplot(t(m),beside=T,col=c('red','blue'),las=2)

enter image description here

Upvotes: 0

Views: 100

Answers (1)

Frank P.
Frank P.

Reputation: 513

I suspect the x-axis labels are character expressions as opposed to dates. Make sure you conform them into a date format in order for R to understand that this is a continuous scale.

Upvotes: 2

Related Questions