I want to replicate the structure of the picture below. I don't want to replicate the appearance.
This LaTeX code
\documentclass[tikz,convert={size=640},multi]{standalone}
\usetikzlibrary{graphs,positioning}
\usepackage{forest}
\forestset{
default preamble={
grow=west,
for tree={
parent anchor=children,
child anchor=east,
anchor=east,
draw
}
}
}
\begin{document}
\begin{forest}
[Acceleration
[Map] [Destination] [Vector] [Location]
[{Kind(Street signs, cars, people,...)},name=kind] [Distance,name=distance]]
\graph {
Pixel -- Line -- Shape[left=of kind.west] -- {(distance.west),(kind.west)}
};
\end{forest}
\begin{tikzpicture}
\graph[grow left,left anchor=west,right anchor=east] {
Acceleration[anchor=west] --
{Map[anchor=east], Destination[anchor=east], Vector[anchor=east],
Location[anchor=east],
{{Kind/{Kind(Street signs, cars, people,...)}[anchor=east],
Distance[anchor=east]} -- Shape[anchor=east]}}
};
\end{tikzpicture}
\end{document}
%%% Local Variables:
%%% TeX-command-extra-options: "-shell-escape"
%%% mode: latex
%%% TeX-master: t
%%% End:
renders the two pictures below.
What did I do wrong? How can I fix the pictures?
Best Answer
It isn't entirely clear what you mean by 'structure'. Normally, for a graph or tree, I'd understand this to mean the way in which the nodes are connected to each other and not the distance and direction of one node relative to another. But it seems you mean the latter as well, although whether this is really it is another matter.
If so, I take it you want something like this:
This is not hard to do in
forest
. It is just a bit fiddly:EDIT
I have no idea what 'vertical space' you ask in the comments to get rid of. The following code sacrifices structural replication for the sake of what may or may not be the desired appearance.