1

So, Im fairly new to creating hierarchy charts in latex. Basically, what I want to do is to connect adjacent nodes. Below is a small example of a hierarchy chart...

\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{shadows.blur}

\begin{document}
    \begin{forest}
for tree={
    draw, semithick, fill=white, blur shadow,
    align=left,
%
    grow'=0,
    anchor = west,
    forked edges,                  
     edge = {-stealth},
    l sep = 2.5em,
 fork sep = 1.2em,
tier/.option = level,
        }
[VImp Methods
 [Model Agnostic
    [Filter Methods
        [Chi-Squared]
        [t-statistic]
        [ANOVA]
    ]
  ]
 [Wrapper Methods
     [Recursive Feature elimination]
     [Backward Elimination]
 ]  
 [Model Based
    [Embedded Methods
        [Random Forest
            [Gini]
            [Permutation]
        ]
    ]
   ]
]
\node [draw, inner sep=1ex,
       fit=(current bounding box.south east) 
           (current bounding box.north west)] {};
\end{forest}
\end{document} 

This produces this: Hierarchy

But what Im trying to achieve is something like this:

Hierarchry 2

In the above example, I want to be able to join Model Agnostic to Model Based... and then have them both join Wrapper Methods.

Any suggestions as to how I would do this?

1 Answer 1

1
\documentclass[border=10pt]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{shadows.blur}

\begin{document}
    \begin{forest}
for tree={
    draw, semithick, fill=white, blur shadow,
    align=left,
%
    grow'=0,
    anchor = west,
    forked edges,                  
     edge = {-stealth},
    l sep = 2.5em,
 fork sep = 1.2em,
tier/.option = level,
        }
[VImp Methods
 [Model Agnostic,alias=agnostic
    [Filter Methods
        [Chi-Squared]
        [t-statistic]
        [ANOVA]
    ]
  ]
 [,phantom,no edge
   [Wrapper Methods,alias=wrap
     [Recursive Feature elimination]
     [Backward Elimination]
     ]
 ]  
 [Model Based,alias=model
    [Embedded Methods
        [Random Forest
            [Gini]
            [Permutation]
        ]
    ]
   ]
]
\draw[-stealth] (agnostic.south) -- (agnostic|-model.north)
  (wrap-|agnostic) -- (wrap.west) ;
\node [draw, inner sep=1ex,
       fit=(current bounding box.south east) 
           (current bounding box.north west)] {};
\end{forest}
\end{document} 

enter image description here

You must log in to answer this question.

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