I would like to include graphics like the following in my document. Since this is just one example and there will be different models, I can't just include it, but will rather need to be able to build it myself. I figured that TikZ would be a convenient way to do so.
I found a promising basis somewhere else on this site, yet so far I haven't been able to adopt it to my specific needs. Basically I fail to include the multi-line items and also might get errors because sometimes there are no 'families' or something like that as in the case of the Netherlands in this example.
What would be the best way to make this happen? I would definitely appreciate the rectangular structure and would like to always scale it to \textwidth or similar. Is this possible? Thanks
\documentclass{article}
\usepackage{tikz-qtree}
\begin{document}
\tikzset{edge from parent/.style=
{draw, edge from parent path={(\tikzparentnode.south)
-- +(0,-8pt)
-| (\tikzchildnode)}},
blank/.style={draw=none}}
\begin{tikzpicture}
\matrix
{
\node{\Tree
[.Class \edge[blank];
[.Order \edge[blank];
[.Family \edge[blank];
[.Genus ]]]]};
&
\node{\Tree
[.{$\gamma$-proteobacteria}
[.Alteromonadales
[.Alteromonadaceae {Glaciecola} Alteromonas Agarivorans ] ]
[.Vibrionales [.Vibrionacae Vibrio ]]]};\\
};
\end{tikzpicture}
\end{document}
Best Answer
If you don't mind, you could switch to the
forest
package which makes it neater to build trees, only using square brackets for writing the tree.The levels are actually a branch of the tree, but the edges are not drawn (using the command
no edge
). Here's how the tree actually appears:Output
Code