Replaced show() to savefig()