yutakashino — Jun 16, 2012, 7:31 PM
#最初の設定
setwd('~/sandbox/nhk/dsmining')
library(ggplot2)
library(scales)
fn <- file("allAprilMayWeeksum.out", open="r", encoding="utf-8")
df <- read.csv(file = fn, header = TRUE, stringsAsFactors=FALSE)
p <- ggplot(df, aes(x=as.POSIXct(datetime, format="%H:%M:%S"), y=num))
p <- p + geom_bar(stat='identity', position='dodge') + facet_wrap(~dofweek, ncol=1)
p <- p + scale_x_datetime(breaks = date_breaks("6 hours"),labels = date_format("%H"))
p <- p + theme_bw() + opts( axis.text.x = theme_text(size = 10),
axis.text.y = theme_text(size = 10),
strip.background = theme_blank())
ggsave(p, file = paste("allAprilMayWeeksum.out.png", sep = ""), width=10, height=7)
p