Gerando gráficos matplotlib sem um servidor X em execução [duplicado]

Esta pergunta já tem uma resposta aqui:

Gerando um PNG com matplotlib quando DISPLAY não está definido 12 respostas

Matplotlib parece exigir a variável de ambiente $ DISPLAY, o que significa um servidor X em execuçã
lguns serviços de hospedagem na web não permitem uma sessão do servidor X em execuçã
Existe uma maneira de gerar gráficos usando matplotlib sem um servidor X em execuçã

[username@hostname ~]$ python2.6
Python 2.6.5 (r265:79063, Nov 23 2010, 02:02:03)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib.pyplot as plt
>>> fig = plt.figure()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/username/lib/python2.6/matplotlib-1.0.1-py2.6-linux-i686.egg/matplotlib/pyplot.py", line 270, in figure
    **kwargs)
  File "/home/username/lib/python2.6/matplotlib-1.0.1-py2.6-linux-i686.egg/matplotlib/backends/backend_tkagg.py", line 80, in new_figure_manager
    window = Tk.Tk()
  File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 1643, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
>>>

questionAnswers(2)

yourAnswerToTheQuestion