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