Tim: I had the same ghost image problem; I fixed it by adding 'set(gcf, 'Renderer', 'zbuffer') around line 18 (after 'set(gca, 'nextplot' ...). I also changed the background color to white because the default was grey by using 'set(gcf, 'Color', [1 1 1])'. Hope that helps.
I cannot get the code to run using Matlab version 220.127.116.115 (R2011a) but it will run using Matlab version 18.104.22.1689 (R2010a). I have the Image Processing Toolbox for the 2011 version but not the 2010 version. Does anyone have the “fix” for newer version of Matlab? All I get is a single image with a “ghost” of what is behind the figure on the screen.