abe<-read.csv('DAT/安倍晋三.dat', header=F)
eda<-read.csv('DAT/枝野幸男.dat', header=F)
shi<-read.csv('DAT/志位和夫.dat', header=F)
kat<-read.csv('DAT/片山虎之助.dat', header=F)
tam<-read.csv('DAT/玉木雄一郎.dat', header=F)
aso<-read.csv('DAT/麻生太郎.dat', header=F)
myplot <- function(title="議員名", color1, color2, data) {
x = data$V1
hist(x,
border = color1, col = color2,
breaks = c(0,20,40,60,80,100,120,140,160,180,200,
220,240,260,280,300,320,340,360,380,400,420),
lwd = 3,
xlim = c(0.0, 400), ylim = c(0.0, 0.018),
freq = FALSE,
main = paste(title, 'による発言の長さ', sep=''),
ylab = '', xlab = '一発話(一文)あたりの文字数')
}
png("graph_r.png", width=2400, height=1280)
par(las=1, mfrow=c(2,3), cex=2.4, lwd=3)
par(family="HiraMaruProN-W4")
myplot(title="A氏", color1="#0288D1", color2="#04C0E8", data=abe)
myplot(title="B氏", color1="#FBC02D", color2="#FFD85A", data=aso)
myplot(title="C氏", color1="#FFEA00", color2="#FFFC80", data=eda)
myplot(title="D氏", color1="#0F9D58", color2="#1FCAB0", data=shi)
myplot(title="E氏", color1="#FF5252", color2="#FFA4A4", data=kat)
myplot(title="F氏", color1="#AFB42B", color2="#D0D858", data=tam)
dev.off()