title: How can I set the 'backend' in matplotlib in Python?
body: <p>I am new user of matplotlib, my platform is Ubuntu 10.04 Python 2.6.5</p>
  
  <p>This is my code</p>
  
  <pre><code>import matplotlib
  matplotlib.use('Agg')
  import matplotlib.pyplot as plt 
  plt.plot([1,2,3])
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>/usr/local/lib/python2.6/dist-packages/matplotlib/backends/__init__.py:41: UserWarning: 
  Your currently selected backend, 'agg' does not support show().
  Please select a GUI backend in your matplotlibrc file ('/usr/local/lib/python2.6/dist-packages/matplotlib/mpl-data/matplotlibrc')
  or with matplotlib.use()
    (backend, matplotlib.matplotlib_fname()))
  </code></pre>
  
  <ul>
  <li>I installed the Anti-Grain Geometry library <code>apt-get install libagg</code> but it is doesn't work.</li>
  <li>I tried to use other argument of backend like 'GTK' and 'TkAgg'.</li>
  <li>I installed <code>python-gtk2-dev</code> package, but still the error is below.</li>
  <li>Can anyone tell me an executable backend argument and its dependency library?</li>
  </ul>
  
  <p>Here is the error:</p>
  
  <pre><code>&gt;&gt;&gt; matplotlib.use('GTK')
  &gt;&gt;&gt; import matplotlib.pyplot as plt
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/local/lib/python2.6/dist-packages/matplotlib/pyplot.py", line 95, in &lt;module&gt;
      new_figure_manager, draw_if_interactive, show = pylab_setup()
    File "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
      globals(),locals(),[backend_name])
    File "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gtk.py", line 28, in &lt;module&gt;
      from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK 
    File "/usr/local/lib/python2.6/dist-packages/matplotlib/backends/backend_gdk.py", line 29, in &lt;module&gt;
      from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
  ImportError: No module named _backend_gdk
  </code></pre>