ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Graphics`Graphics`"];
v[t_]:= -350(3 - 10 t)(20 t - 1)(7 - 20 t)/9;
c = t/.FindMinimum[-v[t],{t,0.32,0.33}][[2]];
under1[njags_]:= Graphics[{GrayLevel[0.35],
	Table[Rectangle[{0.28+0.02(i-1)/njags,v[0.28+0.02(i-1)/njags]},
					{0.28+0.02i/njags,0}],
					{i,1,njags}]}];
under2[njags_]:= Graphics[{GrayLevel[0.35],
	Table[Rectangle[{0.3+(c-0.3)(i-1)/njags,v[0.3+(c-0.3)(i-1)/njags]},
					{0.3+(c-0.3)i/njags,0}],
					{i,1,njags}]}];
under3[njags_]:= Graphics[{GrayLevel[0.35],
	Table[Rectangle[{c+(0.35-c)(i-1)/njags,0},
					{c+(0.35-c)i/njags,v[c+(0.35-c)i/njags]}],
					{i,1,njags}]}];

over1[njags_]:= Graphics[{GrayLevel[0.65],
	Table[Rectangle[{0.28+0.02(i-1)/njags,0},
					{0.28+0.02i/njags,v[0.28+0.02i/njags]}],
					{i,1,njags}]}];
over2[njags_]:= Graphics[{GrayLevel[0.65],
	Table[Rectangle[{0.3+(c-0.3)(i-1)/njags,0},
					{0.3+(c-0.3)i/njags,v[0.3+(c-0.3)i/njags]}],
					{i,1,njags}]}];
over3[njags_]:= Graphics[{GrayLevel[0.65],
	Table[Rectangle[{c+(0.35-c)(i-1)/njags,v[c+(0.35-c)(i-1)/njags]},
					{c+(0.35-c)i/njags,0}],
					{i,1,njags}]}];

flow = Plot[v[t],{t,0.28,0.35}];
uplot[njags_]:= Show[under1[njags],under2[njags],under3[njags],
				flow,AxesLabel->{"t","v"},
				PlotLabel->"Underestimate",
				Axes->True,
				AxesOrigin -> {0.275,0},
				Ticks ->{{0.31,0.325,0.34},{-50,-25,0,25}},
				PlotRange->{{0.275,0.35},{-52,29}}];
oplot[njags_]:= Show[over1[njags],over2[njags],over3[njags],
				flow,AxesLabel->{"t","v"},
				PlotLabel->"Overestimate",
				Axes->True,
				AxesOrigin -> {0.275,0},
				Ticks ->{{0.31,0.325,0.34},{-50,-25,0,25}},
				PlotRange->{{0.275,0.35},{-52,29}}];
est[njags_]:= GraphicsArray[{{uplot[njags]},{oplot[njags]}},
					PlotLabel->StringForm["`` subintervals (n = ``)",3njags,Log[2,njags]]];
Show[GraphicsArray[{{est[16],est[32]},{est[64],est[128]}}],
				PlotLabel->"Figure 12.5"]