Suppose I have a binary tree of depth d, represented by a array of length 2^d - 1. Where left_child(i)=2*i + 1, right_child(i)=2*i + 2
I want to plot the tree to get something like the following full binary tree of depth 4 
(The blue lines can be ignored)
The figure above was plotted with a matrix of shape (depth, 2^depth - 1) where the first column entries all had the root's value (0 in this case), the second column had the upper half as the root's right child and the bottom half as its left child and so on until the last column which had all of the leaf values
I there a simpler way of getting this plot from the linear representation of the tree? Preferably with keeping different branches in different colors
