Python with matplotlib - reusing drawing functions,plt.show()