I want to draw like this http://ompldr.org/vYjN1ZQ
by using the example : http://code.activestate.com/recipes/410158-fractal-tree/ or anything
the algorithm is
def Calculator(Total):
numpyArray = numpy.zeros((Total, 2))
for i in range(1, Total+1):
#if i == Total+1 or i == 1:
numpyArray[i-1, 0] = ((2 * i) - 1)
numpyArray[i-1, 1] = (Total - i + 1)
print "N : %d, l : %d, twig : %d, leaf %d" %(Total, i, numpyArray[i-1,0], numpyArray[i-1,1])
num = input("input number : ")
inputTotal = num
for i in range(1, inputTotal + 1):
Calculator(i)
print '\n'
for example if N=5,
N : 5, l : 1, twig : 1, leaf 5
N : 5, l : 2, twig : 3, leaf 4
N : 5, l : 3, twig : 5, leaf 3
N : 5, l : 4, twig : 7, leaf 2
N : 5, l : 5, twig : 9, leaf 1
the joint of stem will have 1 twig and 5 leaf..
but I don't know how to do this. please help me