0

My data is: [array([5]), array([1,9]), array([0, 4.5, 12.2]), array([-2, 2, 9, 14])]

and I am trying to plot a corresponding "tree" with python. These are the x coord, and theI tried to collect the edges:

    for i in range(0,n+1):
        for j in range(1,i+2):
            if i<n:
                G.add_edge((i,j),(i+1,j))
                G.add_edge((i,j),(i+1,j+1))
    posG={}
    for node in G.node in G.nodes():
        posG[node]=(node[0],n+2+node[0]-2*node[1])

But this do not seem to help me here.

NiRvanA
  • 105
  • 1
  • 1
  • 8
  • 1
    Where are you trying to plot it? Could you give a more thorough example in your code, like what is G, and how do you want to plot the binary tree – Marko Oct 24 '20 at 14:03
  • I am trying to customize the tree from here: https://stackoverflow.com/questions/33712179/plot-lattice-tree-in-python – NiRvanA Oct 24 '20 at 14:28

0 Answers0