localghost wrote:It can't do any harm if you share a complete solution.
What do you mean? You want me to post the entire diagram code?
Also I got another question. Is it possible to have a nested loop to draw the lines for all the nodes. As the code has a pattern. For example, we have 2 columns with different number of nodes in each.

- tikZ-example.png (5.93 KiB) Viewed 9805 times
Here is the explicit code, describing all the lines:
Code: Select all
\path [line] (1-1.south) -- (1-2.north);
\path [line] (2-1.south) -- (2-2.north);
\path [line] (2-2.south) -- (2-3.north);
I want to make a code, connecting all of them. In Perl it would be something like this:
Code: Select all
#1-st element - number of nodes in branch
#2-nd element - branch number
@data = ([2, 1] , [3, 2]);
foreach $element (@data)
{
for($i = 1; $i < $element->[0]; ++$i)
{
$j = $i + 1;
print "\path [line] ($element->[1]-$i.south) -- ($element->[1]-$j.north);";
}
}