使用 matplotlib.pylab 的 imshow 和 python ide?
Use imshow of matplotlib.pylab with a python ide?
我尝试 运行 photutil
中的示例
除了行
之外,一切都很好
plt.imshow(image, cmap='gray_r', origin='lower')
这不会引发异常,但不会显示任何图像。我用埃里克 ide.
之后您需要致电 plt.show()
。
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.
# need to use matplotlib inline if want to show at jupyter Notebook
%matplotlib inline
plt.imshow(image, cmap='gray_r', origin='lower')
plt.show()
我尝试 运行 photutil
中的示例除了行
之外,一切都很好plt.imshow(image, cmap='gray_r', origin='lower')
这不会引发异常,但不会显示任何图像。我用埃里克 ide.
之后您需要致电 plt.show()
。
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.
# need to use matplotlib inline if want to show at jupyter Notebook
%matplotlib inline
plt.imshow(image, cmap='gray_r', origin='lower')
plt.show()