title: Showing empty graph in tkinter until you click the button
body: <p>I want to make GUI app that draws the graph when a button is pressed. I want to have an empty graph on tkinter window, and when you press the button named "Draw", the program should draw the graph.</p>
  
  <p>I made a window that shows the empty graph, and button for drawing, but when button is pressed, nothing happens, and I do not get any error. Can you help me with this?</p>
  
  <p>This is the code:</p>
  
  <pre><code>from tkinter import *
  from tkinter import ttk
  
  import numpy as np
  
  import matplotlib.pyplot as plt
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
  from matplotlib.backend_bases import key_press_handler
  from matplotlib.figure import Figure
  
  myApp = Tk()
  myApp.title("Cost Analysis")                         
  myApp.geometry("1900x1000")
  
  X=[1,4,6,8,9]
  Y=[3,5,7,8,10]
  
  fprojektiTroskovi=Figure(figsize=(7, 4.5),dpi=83)
  GrafikProjektiTroskovi=fprojektiTroskovi.add_subplot(111)
  
  CanvasProjectsTroskovi=FigureCanvasTkAgg(fprojektiTroskovi, master=myApp)
  CanvasProjectsTroskovi.show()
  CanvasProjectsTroskovi.get_tk_widget().grid(row=30,column=0,sticky="wn",padx=5)
  
  toolbar_FrameProjektiTroskovi=Frame(myApp)
  toolbar_FrameProjektiTroskovi.grid(row=1,column=0,sticky="wn",padx=5)
  
  ToolbarProjectsTroskovi = NavigationToolbar2TkAgg(CanvasProjectsTroskovi,toolbar_FrameProjektiTroskovi)
  ToolbarProjectsTroskovi.update()
  CanvasProjectsTroskovi._tkcanvas.grid(row=0,column=0,sticky="wn",padx=5,pady=5)
  
  GrafikProjektiTroskovi.set_xlabel("Size")
  GrafikProjektiTroskovi.set_ylabel("Costs")
  GrafikProjektiTroskovi.set_title("All Projects (Size - Costs)")
  GrafikProjektiTroskovi.grid()
  
  
  def draw_graph():
  
      GrafikProjektiTroskovi.plot(X, Y, color="blue",marker="o", linewidth=1, label="Planned Costs")
  
      GrafikProjektiTroskovi.legend()
  
  button=Button(myApp, text="Draw", command=draw_graph)
  button.grid(row=0,column=1)
  
  myApp.mainloop()
  </code></pre>