% Distribution and density for a step function. Figure 9.6 p. 280.

subplot(1,2,1)
hold on 
axis equal
plot([-1,0,1,2],[0,0,1,1],'b')
plot([0,0],[-1,2],'r:')
plot([-1,2],[0,0],'r:')
axis([-1,2,-1,2])
title('Cumulative Distribution')

subplot(1,2,2)
hold on 
axis equal
plot([-1,0],[0,0],'b')
plot([0,1],[1,1],'b')
plot([1,2],[0,0],'b')
plot([0,0],[-1,2],'r:')
plot([-1,2],[0,0],'r:')
axis([-1,2,-1,2])
title('Density')
