how to create a function that outputs a matplotlib figure?,plt.show()