John Hendy | 14 Jun 2012 00:09
Picon

Re: Aligning Nodes in Large Tree

On Wed, Jun 13, 2012 at 4:42 PM, Bruno Abreu Calfa <bacalfa <at> gmail.com> wrote:
> Hey, John!
>
> Thanks for the prompt reply! I was influenced by this example:
> http://www.texample.net/tikz/examples/merge-sort-recursion-tree/.

No problem.

>
> The nodes are supposed to be empty. I just want them not to be one
> overlapping with each other. I couldn't get the spacing right. And yes, I'm
> also looking for possibly a better way of doing it (notice that the code is
> long!).

Sure. I think it's going to come down to playing with sibling
distance, then. That's about it. Start at the lowest level nodes and
make sure they don't touch. Then move up a level and play with those.
That's basically what I did in that cyclic example. That tree contains
almost 10,000 nodes and it took a lot of futzing for them not to
touch! Here's a version post-processed in gimp to produce the color:
--- http://i.imgur.com/Rkssr.png

>
> I attached a small example picture in which I managed to space the nodes.
> But that was possible because it had fewer nodes so I really didn't have to
> do much. See the code below (never mind about the p_{*,*} labels, but I'm
> interested in putting the t = * on the side):

I'd look into for loops. My example could be written as a "regular
tree" (vs. cyclic) as long as one removed the sibling angle arguments.
(Continue reading)


Gmane