Added another example with complete files.
[docutils/kirr.git] / sandbox / docbook / examples / report2 / charts / outbound_all.R
blobf523cdbca292b5339731857a00c95bb8c50fde48
1 rates <- read.csv("../tables/all.csv")\r
2 x = rates$week\r
3 title=''\r
4 xlab.text="week in year"\r
5 xlab = xlab.text\r
6 ylab = "units/man hour"\r
7 if (make.title == T ) top.margin = 3\r
8 if (make.title != T ) title="" \r
9 if (months.grid == T) bottom.margin = 6\r
10 if (months.grid == T) xlab = ''\r
11 y_picking = rates$rate.picking.2011\r
12 y_singulation = rates$rate.singulate.2011\r
13 y_singles = rates$rate.singles.2011\r
14 y_multis = rates$rate.multis.2011\r
15 png(file="outbound_rate_2011_all.png", width=width, height=4.5, units="in", res=res )\r
16 y_range=range(y_singulation, y_singles, y_multis, y_picking, na.rm=T)\r
17 margins=c(bottom.margin, 4, top.margin, 0.5) \r
18 par(mar=margins) \r
19 par('family'='serif')\r
20 plot(x, type='n', xlab=xlab, ylab=ylab, las=1,\r
21 main=title, ylim=c(y_range), axes=F)\r
22 axis(1, col=ax_col)\r
23 axis(2, col=ax_col, las=1, at=axTicks(2))\r
24 box(col=box_col)\r
25 rect(38, -10, 39, 1000, col=rec_col, border=NA, xpd=F)\r
26 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)\r
27 lines(x,y_picking, col=line_colors[1],  lwd=lwd, lty=line_types[1])\r
28 lines(x,y_singulation, col=line_colors[2],  lwd=lwd, lty=line_types[2])\r
29 lines(x,y_singles, col=line_colors[3],  lwd=lwd, lty=line_types[3])\r
30 lines(x,y_multis, col=line_colors[4],  lwd=lwd, lty=line_types[4])\r
31 # legend(x = 0,y=-50, ncol=4, c("Picking","Singulation", "Singles", "Multis"), cex=legend_font_size, \r
32 #  col=line_colors,  lty=line_types, bty='y', bg="white", box.lwd=box.lwd, xpd = T)\r
33  legend("topleft", c("Picking","Singulation", "Singles", "Multis"), cex=legend_font_size, \r
34   col=line_colors,  lty=line_types, bty='y', bg="white", box.lwd=box.lwd, xpd = T)\r
35 source("make_x_axis.R")\r
36 dev.off()\r