iT邦幫忙

0

為何plt.show()過後,只出現<Figure size 1200x1400 with 0 Axes>,並沒有圖片出現?

  • 分享至 

  • xImage

https://ithelp.ithome.com.tw/upload/images/20230909/20157619ec0eC6EwIF.png

meebox iT邦新手 5 級 ‧ 2023-09-10 11:36:03 檢舉
你最後一行傳入的 num 是 0, 所以在 show_image_labels_predictions() 裡面的 for 迴圈根本不會執行, 所以不會有任何影像出現。
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

2
Samuel
iT邦好手 1 級 ‧ 2023-09-09 17:25:14
增廣建文 iT邦研究生 5 級 ‧ 2023-09-09 19:14:25 檢舉

他前面有call plt.gcf()

2
增廣建文
iT邦研究生 5 級 ‧ 2023-09-09 19:19:54

Jupyternotebook沒顯示的話估計跟設定matplotlib的顯示方式比較有關
可以在cell前面加加看

%matplotlib inline

https://stackoverflow.com/questions/57781578/plt-show-doesnt-render-the-image-on-jupyter-notebook

我要發表回答

立即登入回答