matplotlib plot and imshow

Viewed 37343

The behavior of matplotlib's plot and imshow is confusing to me.

import matplotlib as mpl
import matplotlib.pyplot as plt

If I call plt.show() prior to calling plt.imshow(i), then an error results. If I call plt.imshow(i) prior to calling plt.show(), then everything works perfectly. However, if I close the first figure that gets opened, and then call plt.imshow(i), a new figure is displayed without ever calling plt.show().

Can someone explain this?

1 Answers
Related