ClearAll;
$DefaultFont = {"Times-Roman",10};
Needs["Statistics`DataManipulation`"];
Needs["Graphics`Graphics`"];
wheat = {{0,0}, {5,6}, {10,11}, {15,15}, {25,18}, 
		 {30,16}, {35,14}, {40,10}, {45,6}, {51,0}};
maize = {{12,0}, {15,9}, {20,20}, {25,29}, 
		 {30,35}, {35,38}, {45,30}, {50,7}, {51,0}};
w0[t_]:= t(t+17)(51-t)(5025 - 127 t + t^2);
m0[t_]:= t(t-12)(51-t)(1884 - 71 t + t^2);
approxw[t_] = Fit[wheat,{w0[t]},t];
approxm[t_] = Fit[maize,{m0[t]},t];
s = Abs[FindMinimum[-approxm[t],{t,37,37.1}][[1]]];
wheatscaled = {{0,0}, {5,6/s}, {10,11/s}, {15,15/s}, {25,18/s}, 
		 	   {30,16/s}, {35,14/s}, {40,10/s}, {45,6/s}, {51,0}};
maizescaled = {{12,0}, {15,9/s}, {20,20/s}, {25,29/s}, 
		 	   {30,35/s}, {35,38/s}, {45,30/s}, {50,7/s}, {51,0}};
lpw = ListPlot[wheatscaled];
lpm = ListPlot[maizescaled];
appw[t_] = approxw[t]/s;
appm[t_] = approxm[t]/s;
Print[Factor[appw[t]]];
Print[Factor[appm[t]]];
Print[s];
plot1 = Plot[appw[t],{t,0,51}];
plot2 = Plot[appm[t],{t,12,51}];
upper = Show[plot1,lpw, AxesLabel->{"T"," "},GridLines->Automatic,
	PlotLabel -> "(a) Net photosynthesis versus temperature in wheat",
	PlotRange->{{0,52},{0,1.05}}];
lower = Show[plot2,lpm,AxesLabel->{"T"," "},GridLines->Automatic,
	PlotLabel -> "(b) Net photosynthesis versus temperature in maize",
	PlotRange->{{0,52},{0,1.05}}];
FindMinimum[-appw[t],{t,20,30}]
FindMinimum[-appm[t],{t,37,37.1}]
Show[GraphicsArray[{{upper},{lower}}],PlotLabel->"Figure 8.1"]