3

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)
Sourav Roy
  • 347
  • 3
  • 20
  • Your question is related to pandas, not machine learning. Also, use `isin`. – cs95 Nov 10 '17 at 10:44
  • 2
    I fail to see how the FigureManagerBase issue (the topic of this question) is related to the 'already provdided' answers – Yuca Jul 05 '18 at 18:36
  • 2
    Removing this question doesn't make sense. They're asking about a matplotlib issue (which I also have) and the question is closed referring to a Pandas answer. What am I missing? – d8sconz Oct 12 '18 at 02:12

0 Answers0