removed calls to matplotlib.pyplot.figure to save memory.
Merge remote-tracking branch 'origin/master'