gpt4 book ai didi

python - 将 matplotlib.pylab 的 imshow 与 python ide 一起使用?

转载 作者:行者123 更新时间:2023-12-02 17:29:59 30 4
gpt4 key购买 nike

我尝试在 photutil 中运行示例

一切正常,除了线路

plt.imshow(image, cmap='gray_r', origin='lower')

这不会引发异常但不会显示图像。我用的是 eric ide。

最佳答案

之后你需要调用plt.show()

来自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.

关于python - 将 matplotlib.pylab 的 imshow 与 python ide 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34742842/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com