added pylab close all to avoid overlapping images