% LMex030403_4th
% Example 3.4.3 Plotting 3 normal curves. p 164 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Written by Eugene.Gallagher@umb.edu for EEOS601
% http://alpha.es.umb.edu/faculty/edg/files/edgwebp.html
% Revised 1/12/2011
mu1=-4;
mu2=0;
mu3=3;
sigma1=0.5;
sigma2=1.5;
sigma3=1;
x1=mu1-3*sigma1:0.01:mu1+3*sigma1;
x2=mu2-3*sigma2:0.01:mu2+3*sigma2;
x3=mu3-3*sigma3:0.01:mu3+3*sigma3;
y1=normpdf(x1,mu1,sigma1);
y2=normpdf(x2,mu2,sigma2);
y3=normpdf(x3,mu3,sigma3);
plot(x1,y1,x2,y2,x3,y3);
axis([-6.5 6.5 0 0.9])
title('Figure 3.4.5','FontSize',20)
ylabel('f(t)','FontSize',16)
hold on
% This section plots 3 vertical lines
plot([mu1 mu1],[0 normpdf(mu1,mu1,sigma1)],'-b','LineWidth',1);
plot([mu2 mu2],[0 normpdf(mu2,mu2,sigma2)],'-g','LineWidth',1);
plot([mu3 mu3],[0 normpdf(mu3,mu3,sigma3)],'-r','LineWidth',1);
figure(gcf)
hold off
pause