pylab without X11

marc gtitus_ at
Tue Sep 30 23:10:35 CEST 2008

This may help ... or not ( 2nd part )

try not to do pylab.figure()

in your script:
pylab.plot, or pylab.imshow or whatever you want to use
savefig("myFigure.png")    for example
do not use show()

in my case ( with the WXAgg backend ), it works, it generates the png file


Willem-Jan Vriend a écrit :
> I want to use pylab (matplotlib) on a machine without X11. I'm trying to 
> generate onthefly graphics for an apache2 web service, so they do not 
> have to be displayed on this machine !
> When i do
>    pylab.figure()
> I get the error
>    TclError: couldn't connect to display ":0.0"
> I tried setting the DISPLAY environment variable to "", ":0.0" but I got 
> the same error message.
> Any help is very much appreciated.

More information about the Python-list mailing list