我想在使用gtk文件选择器选择图像后更新matplotlib直方图,但是什么也没有发生,我尝试删除该图,然后再次添加但仍然不起作用,我该怎么办? 这是我的代码main.py
def setup_plot(self):
# /home/jimmyferiawan/Desktop/PengolahanCitra/TugasGrayscale/gs1.png = https://cdn1.imggmi.com/uploads/2019/5/10/17bf55548e331fab0803d55377001622-full.jpg
img = cv2.imread('/home/jimmyferiawan/Desktop/PengolahanCitra/TugasGrayscale/gs1.png',0)
f = Figure(figsize=(5, 4), dpi=100)
a = f.add_subplot(111)
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2*np.pi*t)
a.hist(img.ravel(), 256, [0,256])
self.sw.set_border_width(10)
canvas = FigureCanvas(f)
self.sw.add(canvas)