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