When you close the image displayed by plt.show(), the image is closed and freed from memory.
You should call savefig and savetxt before calling show.
When you close the image displayed by plt.show(), the image is closed and freed from memory.
You should call savefig and savetxt before calling show.