Added another example with complete files.
[docutils/kirr.git] / sandbox / docbook / examples / report2 / charts / predicted_costs_receiving.R
blob45b8cd1336537ba0460a2b7036b1a28ef8f05775
1 data = read.csv("../tables/projected_rates_receive.csv")
2 at <- c(1:12)
3 attach(data)
4 x <- c(1:12)
5 title <- 'Predicted Rate of Returns, 2012'
6 y1 <- Rate.Zappos
7 y2 <- Rate.FCSW
8 png(file="projected_rate_receive.png", width=5,
9 height=3.5, units="in", res=res)
10 xlab.text="month"
11 xlab = xlab.text
12 ylab = "units/man hour"
13 if (make.title == T ) top.margin = 3
14 if (make.title != T ) title="" 
15 margins=c(bottom.margin, 4, top.margin, 0.5) 
16 par(mar=margins) 
17 par('family'='serif')
18 y_range = range(y1, y2, na.rm=T)
19 plot(x, type='n', xlab=xlab, ylab=ylab, las=1, main=title, ylim=c(y_range), axes=F)
20 axis(1, at=at, labels=months, col=ax_col, lab=NULL)  
21 axis(2, col=ax_col, las=1, at=axTicks(2))
22 box(col=box_col)
23 abline( h=axTicks(2), lty=1, lwd=lwd_grid, col=ax_col)
24 lines(x,y1,  col=line_colors[1], type="l", lwd=lwd, lty=line_types[1])
25 lines(x,y2, col=line_colors[2],  lwd=lwd, lty=line_types[2])
26 legend("bottomleft", c("Zappos","FCSW"), cex=legend_font_size, 
27  col=line_colors,  lty=line_types, bty='y', bg="white", box.lwd=box.lwd)
28 dev.off()