def dibujar(final,x,y): print 'dibujar' print 'final',final if final==None: print 'entro al if' return x,y print 'final',final.datos G.add_node(final.datos,pos=(x,y)) pos=nx.get_node_attributes(G,'pos') nx.draw(G,pos) dibujar(final.izquierda,x=x-(x/2),y=-(y*.5)+y) pos=nx.get_node_attributes(G,'pos') G.add_node(final.datos,pos=(x,y)) pos=nx.get_node_attributes(G,'pos') nx.draw(G,pos) dibujar(final.derecha,x=((x)*.5)+x,y=-((y)*.5)+y) return