title: What to use instead of NavigationToolbar2TkAgg?
body: <p>When I run the following script:</p>
  
  <pre><code>import tkinter as tk
  import matplotlib
  import matplotlib.pyplot as plt
  import matplotlib.figure
  import matplotlib.backends.backend_tkagg
  import numpy as np
  
  def on_key_event(event, canvas, toolbar):
      matplotlib.backend_bases.key_press_handler(event, canvas, toolbar)
  
  matplotlib.use('TkAgg')
  root = tk.Tk()
  root.wm_title('Test window')
  fig = matplotlib.figure.Figure(figsize=(9.333, 7), dpi=100)
  a = fig.add_subplot(111)
  axes = fig.gca()
  x = np.linspace(0, 2*np.pi, 100)
  axes.plot(x, np.sin(x), marker='.')
  axes.set_title('sin(x)')
  axes.grid()
  canvas = matplotlib.backends.backend_tkagg.FigureCanvasTkAgg(fig, master=root)
  canvas.draw()
  canvas.get_tk_widget().pack(fill=tk.X, expand=1)
  canvas.mpl_connect(
      'key_press_event',
      lambda event: on_key_event(event, canvas, toolbar)
  )
  toolbar = matplotlib.backends.backend_tkagg.NavigationToolbar2TkAgg(
      canvas, root
  )
  toolbar.update()
  root.bind('&lt;Control-w&gt;', lambda event: root.destroy())
  tk.mainloop()
  </code></pre>
  
  <p>I get a warning:</p>
  
  <pre><code>MatplotlibDeprecationWarning: The NavigationToolbar2TkAgg class was
  deprecated in version 2.2.
  </code></pre>
  
  <p>Why is the <code>NavigationToolbar2TkAg</code> deprecated and what should I use instead?</p>