I am trying to run the code but am facing an error
> AttributeError Traceback (most recent call last) <ipython-input-10-744f62dd690f> in <module>()
4 fig, ax =plt.subplots(1)
5 mngr = plt.get_current_fig_manager()
----> 6 mngr.window.setGeometry(250, 120, 1280, 1024)
7 image =cv2.imread(image_file.path)
8 image=cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
AttributeError: 'FigureManagerBase' object has no attribute 'window'
I tried to change backend and tried to run the code in spyder as well as jupyter nothing is helping. I am using windows 7 and python 3. My code is below
import cv2
import os
from matplotlib import *
import matplotlib
matplotlib.use('Qt4Agg')
import matplotlib.pyplot as plt
from matplotlib.widgets import RectangleSelector
if __name__ =='__main__':
for n,image_file in enumerate(os.scandir(image_folder)):
img= image_file
fig, ax =plt.subplots(1)
mngr = plt.get_current_fig_manager()
mngr.window.setGeometry(250, 120, 1280, 1024)
image =cv2.imread(image_file.path)
image=cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
ax.imshow(image)