# Tikz and drawing siblings on one line tree

I'm using tikz to create a graph of a network. Currently, I'm having difficulties with one tree, where I would like to set it up like the picture below to save space.

1 is the parent and connects to a different part of the diagram. When I make children of one, I create a straight line (and have a straight line going through them). Like this picture

I've read some of the tikz style and documentation and couldn't find the best way of doing this.

edit 1:I need to add more. Here is what I have.

edit 2: here is the whole code. My apologies my first time on tex.stackexchange

\documentclass[a4paper]{article}
\usepackage{tikz}
\usepackage{pgfpages}
\pgfpagesuselayout{2 on 1}[a4paper,landscape,border shrink=5mm]
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,%
decorations.pathreplacing,decorations.pathmorphing,shapes,%
matrix,shapes.symbols}

\begin{document}

\begin{tikzpicture}
\node {1} [rectangle,draw, sibling distance = 40mm]
child{node[rectangle,draw] {1a}
child[grow =
edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.east)}] {node [rectangle,draw,yshift = -20.5mm]{2}}
child[grow =
edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.east)}]  {node [rectangle, draw, yshift =-30.5mm]{3}}
child[grow =
edge from parent path={(\tikzparentnode.south) |- (\tikzchildnode.east)}]  {node [rectangle, draw,yshift = -40.5mm] {4}}
child[grow =
edge from parent path={(\tikzparentnode.south) -| (\tikzchildnode.east)}]  {node [rectangle, draw,yshift = -50.5mm] {5}}
child[grow =
edge from parent path={(\tikzparentnode.south) -| (\tikzchildnode.east)}]  {node [rectangle, draw,yshift = -60.5mm] {6}}
child[grow =
edge from parent path={(\tikzparentnode.south) -| (\tikzchildnode.east)}]  {node [rectangle, draw,yshift = -70.5mm] {7}}}
child{node[rectangle, draw] {1b}}
child{node[rectangle, draw] {2b}}
child{node[rectangle, draw] {3b}}
child{node[rectangle, draw] {4b}}
child{node[rectangle, draw] {5b}};

\end{tikzpicture}

\end{document}

• Hello and welcome to TeX.SX. In its current form, your question might not receive many answers. Please take a look at the How to Ask-page and try to improve your question according to the guidance found there. This may require you to show some effort on your part in terms of attempting a solution. If you have questions about what to do or if you don't quite understand what this means, please ask for clarification using the add comment function. – samcarter_is_at_topanswers.xyz May 19 '16 at 22:12
• See example in TeXample.net: texample.net/media/tikz/examples/PDF/family-tpdfree. – Zarko May 19 '16 at 22:25
• Please always post a complete minimal example i.e. make your code compilable, please, so we can reproduce the issue! – cfr May 19 '16 at 22:29
• Thanks for completing your code. Don't you get compilation errors from that? – cfr May 19 '16 at 22:51

Do you want something like this?

This was drawn using forest, which is a specialist drawing package for trees, based on TikZ.

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
for tree={
draw,
circle,
grow=-180,
edge={thick},
thick,
edge path'={%
(!u.parent anchor) |- (.child anchor)
}
},
for root={
parent anchor=south,
delay={%
prepend={[, phantom, calign with current]}
}
}
[1,
[2]
[3]
[4]
]
\end{forest}
\end{document}

• hey, thanks. I guess I was using the wrong package. I also edited my question. – user2723240 May 19 '16 at 22:46
• Not necessarily. I just like forest because it is particularly powerful and flexible. But you can surely do this with TikZ's own trees or another of the tree-drawing packages, if you prefer. If the nodes were to the right, rather than the left, of the root you could probably use dirtree if you wished. – cfr May 19 '16 at 22:52