问题描述
我尝试在 photutil 中运行示例/p>
一切都很好,除了这条线
plt.imshow(image, cmap='gray_r', origin='lower')不会引发异常但不显示图像.我用的是 eric ide.
之后需要调用plt.show().
来自 Matplotlib 常见问题解答:
<块引用>当您想在显示器上查看绘图时,用户界面后端需要启动 GUI 主循环.这就是 show() 所做的.它告诉 matplotlib 提升到目前为止创建的所有图形窗口并启动主循环.因为这个主循环默认是阻塞的(即脚本执行被暂停),你应该只在每个脚本最后调用一次.关闭最后一个窗口后恢复脚本执行.
I tried to run example in photutil
Everything works great except the line
plt.imshow(image, cmap='gray_r', origin='lower')
which does not raise an exception but no image is shown. I use the eric ide.
You need to call plt.show() afterwards.
From the Matplotlib FAQ:
When you want to view your plots on your display, the user interface backend will need to start the GUI mainloop. This is what show() does. It tells matplotlib to raise all of the figure windows created so far and start the mainloop. Because this mainloop is blocking by default (i.e., script execution is paused), you should only call this once per script, at the end. Script execution is resumed after the last window is closed.
这篇关于将 matplotlib.pylab 的 imshow 与 python ide 一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)