5

I am a bit stuck at drawing a taxonomy diagram. I have never used tikZ package and finding it really difficult to learn it at a short period of time. I need to draw the following taxonomy diagram. Could some please help me with the Latex code for the following diagram. I will be really grateful. Thanks.

enter image description here

2 Answers 2

8

This should meet the requirement -- Help on drawing a tree in latex

Data will have to be punched in

enter image description here

\documentclass[tikz,border=10pt,multi]{standalone}
\usepackage{forest}
\usetikzlibrary{shadows}

\begin{document}
    \tikzset{
        my node/.style={
            draw=gray,
            inner color=gray!5,
            outer color=gray!10,
            thick,
            minimum width=1cm,
%           rounded corners=3,
            text height=1.5ex,
            text depth=0ex,
            font=\sffamily,
            drop shadow,
        }
    }
    \begin{forest}
        for tree={%
            my node,
            l sep+=5pt,
            grow'=east,
            edge={gray, thick},
            parent anchor=east,
            child anchor=west,
            if n children=0{tier=last}{},
            edge path={
                \noexpand\path [draw, \forestoption{edge}] (!u.parent anchor) -- +(10pt,0) |- (.child anchor)\forestoption{edge label};
            },
            if={isodd(n_children())}{
                for children={
                    if={equal(n,(n_children("!u")+1)/2)}{calign with current}{}
                }
            }{}
        }
        [A
        [b
        [l]]
        [c
        [e[m]][f[n]][g[o]][h[p]]]
        [d
        [j[r]][k[s]]]
        ]
    \end{forest}
\end{document}
3
  • 2
    Thanks, very much. I think I can build from here. :)
    – Amit
    Commented Jul 31, 2020 at 12:19
  • remove drop shadow if you do not want the shadows behind nodes
    – js bibra
    Commented Jul 31, 2020 at 12:20
  • Yes did that. It looks good without a shadow
    – Amit
    Commented Jul 31, 2020 at 12:26
4

There are already a right answer using forest, so this is only a community wiki comment: To start, better a simpler example.

\documentclass[tikz,border=10pt]{standalone}
\usepackage[edges]{forest}
\begin{document}
\begin{forest}                      
forked edges,                        
for tree={grow=0,draw, 
font=\strut\footnotesize\sffamily\em}, 
[Homo    
    [Homo ergaster $\dagger$] 
    [Homo erectus 
        [Homo stultus] 
        [Homo sapiens  $\dagger$]]  
    [Homo habilis  $\dagger$ ]]] 
\end{forest}
\end{document}

enter image description here

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .