关闭绘图matplotlib后生成的Python空白

2024-04-23 23:46:13 发布

您现在位置:Python中文网/ 问答频道 /正文

在模式%matplotlib notebook中,当我试图关闭一个图形时,jupyter会在笔记本中留下空白。你知道吗

有没有删除空白的命令,或者关闭图形的正确方法?你知道吗

ma = [int(1000*random.random()) for i in xrange(10000)]

plt.figure()
counts,bins,bars = plt.hist(ma,200,alpha=0.5)
plt.close()

plt.figure()
plt.plot(ma)

IMAGE EXAMPLE


Tags: 方法命令图形formatplotlib模式笔记本jupyter