条形图R上的格式日期轴

时间:2014-08-21 10:34:15

标签: r datetime graph ggplot2 bar-chart

我需要格式化X轴,以显示每5年间隔一次的年份。

当前图表:

enter image description here

我尝试将d2 $ Date转换为字符并使用chron()转换然后使用scale()但是R继续告诉我日期格式仍然不正确。

代码:

d2 <- read.csv("https://dl.dropboxusercontent.com/u/16400709/StackOverflow/Data_Outbreaks_Bar.csv")
head(d2,n=20)

Graph2 <-ggplot(d2, aes(x=d2$Date, y=d2$FujitaMiles)) + geom_bar(stat="identity") + 
labs(x="Date", y="Magnitude")

Graph2

非常感谢任何帮助!

0 个答案:

没有答案
相关问题