"python.exe has stopped working" crash, FigureCanvasTkAgg.show()
<p>I am running an Anaconda environment with python 3.4, on Windows 7
<code>canvas.show()</code> is causing my python code to crash: </p>

<p><strong>EDIT</strong> : my last example was missing the mainloop() function, so I recreated a better example from sentdex's youtube tutorial <a href="https://www.youtube.com/watch?v=Zw6M-BnAPP0&amp;list=PLQVvvaa0QuDclKx-QpC9wntnURXVJqLyk&amp;index=6" rel="nofollow noreferrer">here</a></p>

<p>Here is a shorter example of the code:</p>

<pre><code>import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
import tkinter as tk

LARGE_FONT = ("Verdana", 12)

class SeaofBTCapp(tk.Tk):

  def __init__(self, *args, **kwargs): 
    tk.Tk.__init__(self, *args, **kwargs)  
    container = tk.Frame(self)  
    container.pack(side="top", fill="both", expand=True)
    container.grid_rowconfigure(0, weight=1)
    container.columnconfigure(0, weight=1)

    self.frames = {}
    for F in (StartPage, GraphPage):
        frame = F(container, self)
        self.frames[F] = frame
        frame.grid(row=0, column=0, sticky="nsew")
    self.show_frame(StartPage)

  def show_frame(self, cont):  
    frame = self.frames[cont]
    frame.tkraise() 

class StartPage(tk.Frame): 

  def __init__(self, parent, controller):
    tk.Frame.__init__(self, parent) #idk what the parent thing means 
    label = tk.Label(self, text="Start Page", font=LARGE_FONT)
    label.pack(pady=10, padx=10)    

    page_three_button = tk.Button(self, text="Graph Page", 
        command=lambda: controller.show_frame(GraphPage))
    page_three_button.pack()

class GraphPage(tk.Frame):
  def __init__(self, parent, controller):
    #initialize the tk.Frame you are about to use 
    tk.Frame.__init__(self, parent)
    #make the label so the user knows what page they are on 
    label = tk.Label(self, text="Graph Page!", font=LARGE_FONT)
    label.pack(pady=10, padx=10)

    #keep a way to get back home  
    home_button = tk.Button(self, text="Home Page", 
        command=lambda: controller.show_frame(StartPage))
    home_button.pack()

    f = Figure(figsize=(5,5), dpi=100)

    a = f.add_subplot(111) 
    a.plot([1,2,3,4,5], [5,4,3,2,1]) 

    canvas = FigureCanvasTkAgg(f, self)
    canvas.show()
    canvas.get_tk_widget().pack(side=tk.TOP, fill=tk.BOTH, expand=True)

app = SeaofBTCapp()
app.mainloop()
</code></pre>

<p><a href="https://i.stack.imgur.com/uYyLK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uYyLK.png" alt="enter image description here"></a></p>

<p>Unfortunately when I click "check online for solution" nothing pops up. 
When i comment out <code>canvas.show()</code>, the program runs and the error message does not pop up.</p>