pymatplotlib without xserver

Posted by vigilant on Super User See other posts from Super User or by vigilant
Published on 2010-12-23T18:53:29Z Indexed on 2010/12/23 18:56 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

Is it possible to use networkx or pymatplotlib without an xserver running? I keep getting the following error with their first example (of networkx):

Traceback (most recent call last):
  File "test.py", line 17, in <module>
    nx.draw(G,pos,node_color='#A0CBE2',edge_color=colors,width=4,edge_cmap=plt.cm.Blues,with_labels=False)
  File "/usr/local/lib/python2.6/dist-packages/networkx-1.3-py2.6.egg/networkx/drawing/nx_pylab.py", line 124, in draw
    cf=pylab.gcf()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 276, in gcf
    return figure()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 254, in figure
    **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 90, in new_figure_manager
    window = Tk.Tk()
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1646, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ""

© Super User or respective owner

Related posts about python

Related posts about pymatplotlib

  • pymatplotlib without xserver

    as seen on Super User - Search for 'Super User'
    Is it possible to use networkx or pymatplotlib without an xserver running? I keep getting the following error with their first example (of networkx): Traceback (most recent call last): File "test.py", line 17, in <module> nx.draw(G,pos,node_color='#A0CBE2',edge_color=colors,width=4,edge_cmap=plt… >>> More