% LM Fig050101_4th
% Plot of Poisson pdf at lambda=1 & lambda = 4
% Example of a stem plot
% Written by E. Gallagher, Eugene.Gallagher@umb.edu
% Written 10/28/10;
%
k1=0:8;pxk1=poisspdf(k1,1);
k4=0:12;pxk4=poisspdf(k4,4);
subplot(1,2,1);
h1=stem(k1,pxk1,'Marker','none');
set(h1,'LineWidth',3);
ylabel('P_x(k)','FontSize',20)
xlabel('k','FontSize',20)
text(2.5, 0.25,'lambda=1','FontSize',18)
title('Figure 5.1.1','FontSize',22)
axis([-.5 8.5 0 0.4]);
subplot(1,2,2);
h2=stem(k4,pxk4,'Marker','none');
xlabel('k','FontSize',20)
axis([-.5 12.5 0 0.4])
text(4.5, 0.25, 'lambda = 4','FontSize',18)
set(h2,'LineWidth',3)
figure(gcf);pause