title: Python 3.5/Tkinter: Using Matplotlib in a multi-frame GUI (keeps crashing!)
body: <p>I am trying to achieve something very similar to this question (<a href="https://stackoverflow.com/questions/36928338/cannot-draw-matplotlib-chart-in-tkinter-gui-without-crashing">cannot draw matplotlib chart in tkinter GUI without crashing</a>). The only differences between the code shown in the link and my code are as follows: </p>
  
  <p>-Instead of using <code>canvas.get_tk_widget().pack(...)</code>, I am using <code>canvas.get_tk_widget().grid(...)</code>. </p>
  
  <p>-For each of my individual frames, I do a <code>columnconfigure</code> and <code>rowconfigure</code> because that's how I organize my GUI elements in each frame. </p>
  
  <p>-My version of Spyder, Matplotlib, and Tkinter are all the latest versions (I'm using Anaconda ontop of it all). </p>
  
  <p>-I don't recieve any sort of warning or error, my console window in Spyder simply stops, and I have to restart my kernel. </p>
  
  <p>I've seen pretty much all tutorials regarding matplotlib and tkinter. At this point I'm ready to give up. </p>
  
  <p>EDIT #2: When I copy and paste this code (<a href="https://pythonprogramming.net/how-to-embed-matplotlib-graph-tkinter-gui/" rel="nofollow noreferrer">https://pythonprogramming.net/how-to-embed-matplotlib-graph-tkinter-gui/</a>), I get the exact same error. This leads me to think that maybe it's something to do with my installations. </p>
  
  <p>EDIT: Skeleton Version of Code/Problem Code </p>
  
  <p>Master App Class:</p>
  
  <pre><code>  class iSEEApp(tk.Tk):
  
          def __init__(self, *args, **kwargs):
              tk.Tk.__init__(self, *args, **kwargs)
  
              tk.Tk.wm_title(self, "GUI V0.5")
  
              container = tk.Frame(self)
              container.winfo_toplevel().geometry("600x600")
              container.pack(side="top", fill="both", expand=True)
              container.grid_rowconfigure(0, weight=1)
              container.grid_columnconfigure(0, weight=1)
  
              self.frames = {}
              for F in (pixelAnnoPage, patchAnnoPage, heatMapPage):
                  page_name = F.__name__
                  frame = F(parent=container, controller=self)
                  self.frames[page_name] = frame
  
                  frame.grid(row=0, column=0, sticky="nsew")
  
              self.show_frame("pixelAnnoPage")
  
          def show_frame(self, page_name):
              frame = self.frames[page_name]
              frame.tkraise()
              frame.focus_set()
  </code></pre>
  
  <p>General Frame Class Construction/Convention:</p>
  
  <pre><code> class heatMapPage(tk.Frame):
  
          def __init__(self, parent, controller):
              tk.Frame.__init__(self, parent)
              self.controller = controller 
              self.buildFrame()
  
          def buildFrame(self):
              print("test")
  
              #self.pack(fill="both", expand=True)
              self.columnconfigure(1, weight = 1)
              self.columnconfigure(3, pad = 7)
              self.rowconfigure(3, weight = 1)
              self.rowconfigure(5, pad = 7)        
  </code></pre>
  
  <p>Problem Code (in <code>buildFrame()</code>): </p>
  
  <pre><code>    self.heatFig = Figure(figsize=(5, 4), dpi=100)
      self.heatPlot = self.heatFig.add_subplot(111)
      self.heatPlot.plot([1,2,3,4,5,6,7,8],[5,6,7,8,1,2,2,1])
  
      self.heatCanvas = FigureCanvasTkAgg(self.heatFig, master=self)
      self.heatCanvas.get_tk_widget().grid(row=1, column=0, columnspan=2, rowspan=4, padx=5, sticky="nsew") 
      self.heatCanvas.show()
  </code></pre>