title: Unable to get desired output in a Tkinter window for a line graph
body: <p>I'm new to coding and i'm trying to create a Tkinter window using Matplotlib classes that allows me to manipulate a line graph depicting the share prices for 4 companies over two years in a separate window, this is the code I've written:</p>
  <pre><code>from tkinter import *
  
  from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,NavigationToolbar2Tk)
  
  from matplotlib.backend_bases import key_press_handler
  
  from matplotlib.figure import Figure
  
  import pandas as pd
  root = Tk ()
  
  data = pd.read_csv('C:\\Users\\Admin\\Desktop\\shares.csv')
  df = data.iloc[:,:5]
  print(df)
  print()
  
  fig = Figure( figsize = (20,5) , dpi = 100 )
  
  ax1 = fig.add_subplot()
  
  df.plot('Date',figsize = (20,5),  ax = ax1)
  
  canvas = FigureCanvasTkAgg ( fig , root )
  
  canvas.draw()
  
  canvas.get_tk_widget().pack(side = TOP, fill = BOTH, expand = 1)
  
  df.plot(kind = 'bar' , ax = ax1)
  
  toolbar = NavigationToolbar2Tk(canvas, root)
  
  toolbar.update()
  
  canvas.get_tk_widget().pack(side = TOP, fill = BOTH, expand = 1)
  
  def on_key(event):
      print('You Pressed {}'.format(event.key))
      key_press_handler(event, canvas, toolbar)
      
  canvas.mpl_connect('key_press_event' , on_key)  
    
  def Quit():
      root.quit()
      root.destroy()
      return
  
  button = Button(root, text = 'QUIT' , command = Quit )
  
  button.pack ()
  root.mainloop()
  </code></pre>
  <p>This is the output I have obtained:</p>
  <p><a href="https://i.stack.imgur.com/kpA2j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kpA2j.png" alt="enter image description here" /></a></p>
  <p>Whereas this is the desired graph:</p>
  <p><a href="https://i.stack.imgur.com/4n6Zh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4n6Zh.png" alt="enter image description here" /></a></p>
  <p>I would appreciate any input as to how I can fix this, and make my code better.</p>
  <p>Thanks :)</p>