title: Easiest way to install a GUI backend for matplotlib?
body: <p>I have been struggling to get plot using <code>matplotlib.pyplot</code>. Obviously, the problem is</p>
  <pre><code>temp.py:58: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
    plt.show()
  </code></pre>
  <p>I realised that there are multiple backends to switch to, and 's snippet helped me list all inactive GUI backends.</p>
  <pre class="lang-py prettyprint-override"><code>import matplotlib
  gui_env = [i for i in matplotlib.rcsetup.interactive_bk]
  non_gui_backends = matplotlib.rcsetup.non_interactive_bk
  print (&quot;Non Gui backends are:&quot;, non_gui_backends)
  print (&quot;Gui backends I will test for&quot;, gui_env)
  for gui in gui_env:
      print (&quot;testing&quot;, gui)
      try:
          matplotlib.use(gui,warn=False, force=True)
          from matplotlib import pyplot as plt
          print (&quot;    &quot;,gui, &quot;Is Available&quot;)
          plt.plot([1.5,2.0,2.5])
          fig = plt.gcf()
          fig.suptitle(gui)
          plt.show()
          print (&quot;Using ..... &quot;,matplotlib.get_backend())
      except:
          print (&quot;    &quot;,gui, &quot;Not found&quot;)
  </code></pre>
  <p>To which I got</p>
  <pre><code>testing GTK3Agg
       GTK3Agg Not found
  testing GTK3Cairo
       GTK3Cairo Not found
  testing MacOSX
       MacOSX Not found
  testing nbAgg
       nbAgg Not found
  testing Qt4Agg
       Qt4Agg Not found
  testing Qt4Cairo
       Qt4Cairo Not found
  testing Qt5Agg
       Qt5Agg Not found
  testing Qt5Cairo
       Qt5Cairo Not found
  testing TkAgg
       TkAgg Not found
  testing TkCairo
       TkCairo Not found
  testing WebAgg
       WebAgg Not found
  testing WX
       WX Not found
  testing WXAgg
       WXAgg Not found
  testing WXCairo
       WXCairo Not found
  </code></pre>
  <h3>Some methods to setup a GUI backend suggest reinstalling python after installing some dependencies but I am looking for a simpler method (if any exists) .</h3>