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}];
underflowplot = Show[under1[8],under2[8],under3[8],
				flow,AxesLabel->{"t","v"},
				PlotLabel->"(a) Underestimate (n = 3)",
				Axes->True,
				AxesOrigin -> {0.275,0},
				Ticks ->{{0.31,0.325,0.34},{-50,-25,0,25}},
				PlotRange->{{0.275,0.35},{-52,29}}];
overflowplot = Show[over1[8],over2[8],over3[8],
				flow,AxesLabel->{"t","v"},
				PlotLabel->"(b) Overestimate (n = 3)",
				Axes->True,
				AxesOrigin -> {0.275,0},
				Ticks ->{{0.31,0.325,0.34},{-50,-25,0,25}},
				PlotRange->{{0.275,0.35},{-52,29}}];
Show[GraphicsArray[{{underflowplot},{overflowplot}}],
					PlotLabel->"Figure 12.4"]