无法在vscode中获取matplotlib的输出

时间:2020-08-06 12:36:01

标签: python-3.x numpy matplotlib

import numpy as np 
import cv2
import matplotlib.pyplot as plt
from PIL import Image
img = cv2.imread('mountain1.jpg')
# Opencv uses BGR. Hence we have to convert it into RGB to get a proper output
newimg = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# print(img.shape)
plt.imshow(newimg)
plt.show()

它在Sublime Text 3中完全可以正常工作,但在vscode中无法获得任何输出。

0 个答案:

没有答案