title: PyQT5 slot with Matplotlib has no effect
body: <p>I'm trying to implement a slot method that will clear a matplotlib figure that is part of QtWidget. I have tried with both Python 3.6 and 3.5  on windows 7 and 10 and i get same behaviour.</p>
  
  <p>My issue is that i can perfectly clear the figure when calling the wipe method from the main block of code or within the class drawing the figure. But whenever this very same method is called as a slot to a PyQT signal, slot is actually activated but the call to fig.clf() does not clear the figure.</p>
  
  <p>The code below shows the issue :</p>
  
  <pre><code>import sys
  from PyQt5.QtCore import *
  from PyQt5.QtWidgets import QApplication,QMainWindow, QSizePolicy,QWidget,QVBoxLayout, QPushButton
  from matplotlib.figure import Figure
  from matplotlib.backends.backend_qt5agg  import FigureCanvasQTAgg as FigureCanvas
  
  
  class GraphPopulate(FigureCanvas):
  
      def __init__(self, parent=None):
          self.fig = Figure(figsize=(6,4))
          self.ax = self.fig.add_axes([0.07, 0.16, 0.95, 0.95])  # fraction of figure size  #
          FigureCanvas.__init__(self, self.fig)
          self.setParent(parent)
          x = [2000, 2001, 2002, 2003, 2004]
          y = [10, 20, 30, 40, 50]
          self.plt = self.ax.plot(x, y)
  
          # self.wipe()  # OK This one works as well
          # self.plt.close(self.fig) # close the app, does not only clear figure
  
      def wipe(self):
          print('wipe start')
          # del self.fig  # close the app  on second call, does not only clear figure !!
          # self.plt.close(fig) # close the app, does not only clear figure
          rc = self.fig.clf()
          print('return code from clf()  '+ str(rc))
          print('wipe stop')
  
  
  if __name__ == '__main__':
  
      # create main window
      app = QApplication(sys.argv)
      MainWindow = QMainWindow()
      MainWindow.resize(800, 600)
  
      # create widget to be used by MathPlotlib
      WidgetMatplot = QWidget(MainWindow)
      WidgetMatplot.setGeometry(QRect(10, 40, 500, 500))
  
      # create Push Button with clicked signal linked to GraphPopulate.wipe() slot
      button = QPushButton(MainWindow)
      button.setText("Push Me !")
  
      # add widget to vertical box layout
      hbox = QVBoxLayout(MainWindow)
      hbox.addWidget(WidgetMatplot)
      hbox.addWidget(button)
  
      g = GraphPopulate(WidgetMatplot)
  
      button.pyqtConfigure(clicked=g.wipe)  # NOT OK !!!!!!! g.wipe is triggered as prints statements show
                                            #  on console but self.fig.clf() has no effect
  
      MainWindow.show()
      # g.wipe()  # OK
      sys.exit(app.exec_())
  </code></pre>
  
  <p>I've put comments on statements that if uncommented are actually clearing the figure or closing the whole app.</p>
  
  <p>Looks like the "matplotlib context" is not the same when called from the signa-slot connect than from other calls. </p>
  
  <p>May be i miss something trivial. If so sorry for that but i couldn't find any direction to investigate by myself...so i rely on you guys to spot it out.</p>
  
  <p>Thanks - Thibault</p>