I’m trying to create an image using matplotlib.pyplot.imshow(). However, when I run the program from my console, it doesn’t display anything?
This is the code:
import matplotlib.pyplot
myimage = gen_image()
matplotlib.pyplot.gray()
matplotlib.pyplot.imshow(results)
But this shows nothing.
You have to call the
showfunction to actually display anything, likeUnfortunately the matplotlib documentation seems to be currently broken, so I can’t provide a link.
Note that for interactive plotting one typically uses IPython, which has special support for matplotlib.
By the way, you can do
to make the typing less tedious (this is pretty much the official standard way).