title: matplotlib add to panedwindow in tkinter
body: <p>I do not understand how correctly add matplotlib into panedwindow of tkinter.
  I want to have on one side list box and matplotlib interactive plot, on the other side
  I need to resize listbox and plot by dragging boundary between them</p>
  
  <p><a href="https://i.stack.imgur.com/oJ314.png" rel="nofollow noreferrer">this is what is desirable</a></p>
  
  <p>I tried this but I cannot add correctly matplot lib to paned window</p>
  
  <pre><code>from tkinter import *
  
  from matplotlib.backends.backend_tkagg import (
      FigureCanvasTkAgg, NavigationToolbar2Tk)
  # Implement the default Matplotlib key bindings.
  from matplotlib.backend_bases import key_press_handler
  from matplotlib.figure import Figure
  import matplotlib.pyplot as plt
  
  import numpy as np
  
  root = Tk()
  
  m = PanedWindow(root)
  m.pack(fill=BOTH, expand=1)
  
  
  
  
  fig = Figure(figsize=(5, 4), dpi=100)
  t = np.arange(0, 3, .01)
  fig.add_subplot(111).plot(t, 2 * np.sin(2 * np.pi * t))
  
  canvas = FigureCanvasTkAgg(fig, master = root)  # A tk.DrawingArea.
  canvas.draw()
  canvas.get_tk_widget().pack(side=RIGHT, fill=BOTH, expand=1)
  
  toolbar = NavigationToolbar2Tk(canvas, root)
  toolbar.update()
  canvas.get_tk_widget().pack(side=RIGHT, fill=BOTH, expand=1)
  m.add(toolbar)
  m.add(canvas)
  
  
  
  lstbox2 = Listbox(selectmode=MULTIPLE, width=20, height=10)
  m.add(lstbox2) 
  
  root.mainloop()
  </code></pre>