Added another example with complete files.
[docutils/kirr.git] / sandbox / docbook / examples / report2 / charts / shipping_2011.R
blob8e6657aea194fe13689b124d0c2641077990ef37
1 rates <- read.csv("../tables/all.csv")\r
2 x <- rates$week\r
3 title <- ''\r
4 y <- rates$rate.shipping.2011\r
5 png(file="shipping_rate_2011.png", width=width, height=3.5, units="in", res=res )\r
6 xlab.text="week in year"\r
7 xlab = xlab.text\r
8 ylab = "units/man hour"\r
9 if (make.title == T ) top.margin = 3\r
10 if (make.title != T ) title="" \r
11 if (months.grid == T) bottom.margin = 6\r
12 if (months.grid == T) xlab = ''\r
13 margins=c(bottom.margin, 4, top.margin, 0.5) \r
14 par(mar=margins) \r
15 par('family'='serif')\r
16 y_range = range(y)\r
17 plot(x, type='n', xlab=xlab, ylab=ylab, las=1, main=title, ylim=y_range, axes=F)\r
18 rect(38, -10, 39, 450, col="lightgray", border=NA)\r
19 axis(1, col=ax_col)\r
20 axis(2, col=ax_col, las=1, at=axTicks(2))\r
21 box(col=box_col)\r
22 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)\r
23 lines(x,y,  col=line_colors[2], type="l", lwd=lwd)\r
24 source("make_x_axis.R")\r
25 arrows(x0=39, x1=32, y0=300, y1=300, length=.1)\r
26 arrows(x0=39, x1=36, y0=300, y1=225, length=.1)\r
27 text(pos=4, labels="PANDA stations\n removed", x=39,y=300, cex=.8)\r
28 dev.off()\r