The first call to matshow() re-enables interactive mode after it has been disabled by matplotlib.interactive(False). In a Jupyter notebook, this has the result of a figure not intended for display ...