Added another example with complete files.
[docutils/kirr.git] / sandbox / docbook / examples / report2 / charts / putaway_2010_2011.R
blob0a197a80490e628d32dd0865994b0f546541d613
1 rates <- read.csv("../tables/all.csv")
2 x = rates$week
3 title=''
4 y1 = rates$rate.putaway.2010
5 y2 = rates$rate.putaway.2011
6 png(file="putaway_rate_2010_2011.png", width=5, height=3.5, units="in", res=res )
7 xlab.text="week in year"
8 xlab = xlab.text
9 ylab = "units/man hour"
10 if (make.title == T ) top.margin = 3
11 if (make.title != T ) title="" 
12 if (months.grid == T) bottom.margin = 6
13 if (months.grid == T) xlab = ''
14 margins=c(bottom.margin, 4, top.margin, 0.5) 
15 par(mar=margins) 
16 par('family'='serif')
17 plot(x, type='n', xlab=xlab, ylab=ylab, las=1,
18 main=title, ylim=c(range(y1,y2,na.rm = T)), axes=F)
19 axis(1, col=ax_col)
20 axis(2, col=ax_col, las=1, at=axTicks(2))
21 box(col=box_col)
22 # rect(37, -10, 39, 260, col="lightgray", border=NA)
23 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)
24 lines(x,y1, col=line_colors[1],  lwd=lwd, lty=line_types[1])
25 lines(x, y2, col=line_colors[2],  lwd=lwd, lty=line_types[2])
26 legend("bottomleft", c("2010", "2011"), cex=legend_font_size, 
27  col=line_colors,  lty=line_types, bty='y', box.lwd=box.lwd)
28 source("make_x_axis.R")
29 dev.off()