[Tex/LaTex] Tools for tree diagram

diagramstrees

I would like to make a simple scheme looking like tree diagram (structure like this or that). The problem is that all the packages I did try, could make nice binary trees with little information in the nodes. My tree is not binary and I need to put some words on each node, so what tools could you recommend me to try for this?

Best Answer

I think TikZ can do that without problem and without library. It's possible to add some parameters if you want to change something automatically. You can with the next method to scale without problem.

\documentclass[11pt]{scrartcl}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[every node/.style = {shape          = rectangle,
                                         rounded corners,
                                         fill           = blue!40!white,
                                         minimum width  = 3cm,
                                         minimum height = 1.5cm,
                                         align          = center,
                                         text           = white},
                   blue edge/.style  = { -,
                                         ultra thick,
                                         blue!40!white,
                                         shorten >= 4pt}]

% the nodes : possible  \newcommand*\dx{5} \newcommand*\dy{2}
\node(0;0) at (0,0) {Eukaryotes};
  \node(1;2)  at (5, 4) {Unikonts};   
  \node(1;1)  at (5, 2) {Chromalveolates}; 
  \node(1;0)  at (5, 0) {Excavates}; 
  \node(1;-1) at (5,-2) {Rhizaria}; 
  \node(1;-2) at (5,-4) {Plantae\\
                   (Archeplastida)};
     \node(2;1)  at (10,-2) {Conifers};
     \node(2;0)  at (10,-4) {Gnetales};
     \node(2;-1) at (10,-6) {Angiosperms};

% edges 
\foreach \j in {-2,...,2}
  { \draw[blue edge] (0;0.east) -- (1;\j.west); }
\foreach \j in {-1,...,1}
  { \draw[blue edge] (1;-2.east) -- (2;\j.west);}                  
\end{tikzpicture}
\end{document} 

enter image description here

If you want to modify the position with parameters:

\documentclass[11pt]{scrartcl}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[every node/.style = {shape          = rectangle,
                                         rounded corners,
                                         fill           = blue!40!white,
                                         minimum width  = 3cm,
                                         minimum height = 1.5cm,
                                         align          = center,
                                         text           = white},
                   blue edge/.style  = { -,
                                         ultra thick,
                                         blue!40!white,
                                         shorten >= 4pt}] 

\newcommand*\dx{5} \newcommand*\dy{2} 
% nodes 
\node(0;0) at (0,0) {Eukaryotes};
  \node(1;2)   at (\dx, 2*\dy) {Unikonts};   
  \node(1;1)   at (\dx, \dy)   {Chromalveolates}; 
  \node(1;0)   at (\dx, 0)     {Excavates}; 
  \node(1;-1)  at (\dx,-\dy)   {Rhizaria}; 
  \node(1;-2)  at (\dx,-2*\dy) {Plantae\\
                               (Archeplastida)};
     \node(2;1)  at (2*\dx,-\dy)   {Conifers};
     \node(2;0)  at (2*\dx,-2*\dy) {Gnetales};
     \node(2;-1) at (2*\dx,-3*\dy) {Angiosperms};

% edges     
\foreach \j in {-2,...,2}
  { \draw[blue edge] (0;0.east) -- (1;\j.west); }
\foreach \j in {-1,...,1}
  { \draw[blue edge] (1;-2.east) -- (2;\j.west);}                  
\end{tikzpicture}
\end{document}