我正在使用Ubuntu14.04,在Jupyter笔记本上使用Anaconda2.7进行编码,其他一切都是最新的。今天我在编码,每件事都很好。我合上笔记本,当我重新打开它时,除了没有显示图像外,所有的东西都工作得很好。

%matplotlib inline
import numpy as np
import skimage
from skimage import data
from matplotlib import pyplot as plt
%pylab inline

img = data.camera()
plt.imshow(img,cmap='gray')

这是我正在使用的代码,非常简单,但不显示图像
<matplotlib.image.AxesImage at 0xaf7017ac>

这将显示在输出区域中
请帮忙

最佳答案

你需要告诉matplotlib来实际显示图像。在你的部分末尾加上这个:

plt.show()

关于python - matplotlib不在Jupyter Notebook上显示图像,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39416004/

10-12 07:35
查看更多