ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Graphics`Graphics`"];
f1[t_]:= 350(3 - 10 t)(20 t - 1)(7 - 20 t)/9;
f2[t_]:= -1632000(1 - 30 t/23)(t - 2/5)(3/4 - t)/49;
f3[t_]:= -1120000(1 - 12 t/11)(t - 3/4)(9/10 - t)/6;
f[t_]:= Which[t<=1/20,0,t<=7/20,f1[t],t<=2/5,0,
						 t<=3/4,f2[t],t<=9/10,f3[t]];
v[t_]:= -f[t];
njags = 100;
poly[a_,b_,f_]:= Join[Table[{a+i(b-a)/njags,f[a+i(b-a)/njags]},
				  {i,0,njags}],{{b,0},{a,0}}];
shade[a_,b_,c_,f_]:= Graphics[{GrayLevel[c],Polygon[poly[a,b,f]]}];
oshading = Show[shade[0.05,0.3,0.65,f],shade[0.3,0.35,0.65,f],
			   shade[0.4,0.74,0.65,f],shade[0.75,0.9,0.65,f],
			   Ticks->{Table[{0.05i," "},{i,7,17}],{-200,0,200,400}},
			   Axes->True,AxesLabel->{"t","y"}];
ishading = Show[shade[0.05,0.3,0.65,v],shade[0.3,0.35,0.65,v],
			   shade[0.4,0.74,0.65,v],shade[0.75,0.9,0.65,v],
			   Ticks->{Table[{0.05i," "},{i,5}],{-400,-200,0,200}},
			   Axes->True,AxesLabel->{"t","y"}];
otext1 = Graphics[Text["70.9",{0.15,200}]];
otext2 = Graphics[Text["0.9",{0.333,-50}]];
otext3 = Graphics[Text["59.5",{0.55,-100}]];
otext4 = Graphics[Text["10.5",{0.81,-40}]];
itext1 = Graphics[Text["70.9",{0.15,-200}]];
itext2 = Graphics[Text["0.9",{0.333,50}]];
itext3 = Graphics[Text["59.5",{0.55,100}]];
itext4 = Graphics[Text["10.5",{0.81,40}]];

fplot = Plot[f[t],{t,0,9/10},PlotRange->{{0,9/10},{-320,480}}];
vplot = Plot[v[t],{t,0,9/10},PlotRange->{{0,9/10},{-480,320}}];

oflow = Show[oshading,fplot,otext1,otext2,otext3,otext4,
	PlotLabel->"(a) Ventricular Outflow (ml/s)\n\n                 y = f(t)"];
iflow = Show[ishading,vplot,itext1,itext2,itext3,itext4,
	PlotLabel->"(b) Ventricular Inflow (ml/s)\n\n                 y = v(t)"];
Show[GraphicsArray[{{oflow},{iflow}}],
		PlotLabel->"Figure 8.6"]