Or after writing, plt.savefig('N.png'), you can continue on the next line and write plt.show(). The error will no longer show.
plt.savefig('N.png'),
plt.show()