
Estoy usando tikzpicture para dibujar la conexión entre los nodos en Latex. Sin embargo, las conexiones no están bien. Me gustaría saber cómo puedo obtener el resultado esperado en el lado derecho. Actualmente, utilicé el siguiente código y el resultado se muestra en el lado izquierdo. gracias de antemano
\documentclass{article}
\usepackage{graphicx}
\usepackage{caption,subfig}
\usepackage{float}
\usepackage{xcolor}
\usepackage{tikz-qtree}
\usetikzlibrary{trees} % this is to allow the fork right path
\usepackage{tikz, xcolor}
\usetikzlibrary{shapes,arrows}
\usepackage[draft]{todonotes} % notes showed
\begin{document}
\begin{figure} [H]
\centering
\begin{tikzpicture}[node distance = 3cm, auto]
% Place nodes
\node [label=above: A](A) {\includegraphics[width=0.15\textwidth]{example-image-a}};
\node [label=below: B,below right=1cm and 1cm of A] (B) {\includegraphics[width=0.15\textwidth]{example-image-b}};
\node [label=above: C ,above right=1cm and 1cm of A] (C) {\includegraphics[width=0.15\textwidth]{example-image-c}};
\node [label=below: D,right = 1cm of B] (D) {\includegraphics[width=0.15\textwidth]{example-image-a}};
\node [label=above: E,right = 1cm of C] (E) {\includegraphics[width=0.15\textwidth]{example-image-b}};
\node [label=above: result1 ,right = 1cm of D] (result1){};
\node [label=above: result2 ,right = 1cm of E] (result2){};
\node [label=above: result3 ,above of= result1] (result3){};
% Draw arrow
\draw[line width=0.3mm,->] (A) to (B);
\draw[line width=0.3mm,->] (A) to (C);
\draw[line width=0.3mm,->] (B) to (D);
\draw[line width=0.3mm,->] (C) to (E);
\draw[line width=0.3mm,->] (D) to (result1);
\draw[line width=0.3mm,->] (E) to (result2);
\draw[line width=0.3mm,->] (E) to (result3);
\draw[line width=0.3mm,->] (D) to (result3);
\end{tikzpicture}
\captionsetup{labelfont={bf},font={color=blue}}
\caption{Test graph}
\label{fig:2n}
\end{figure}
\end{document}
Respuesta1
Puedes usar |-
y -|
en combinación con--
\draw[line width=0.3mm,->] (A) -- ++(1.5cm,0) |- (B);
\draw[line width=0.3mm,->] (A) -- ++(1.5cm,0) |- (C);
\draw[line width=0.3mm,->] (E) -- ++(1.5cm,0) |- (result3);
\draw[line width=0.3mm,->] (D) -- ++(1.5cm,0) |- (result3);