Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
Merge arrows with TikZ

Is there a way to join two arrows? They should start from two different nodes, join and point to a third node. That would be great!

here I have a minimal example:

    \begin{tikzpicture}
        \tikzstyle{every node}=[draw,shape=ellipse];
        \node (node1) at (150:3) {x};
        \node (node2) at ( 30:3) {y};
        \node (node3) at ( 270:0) {z};

        \path[->] (node1) edge [out=-20, in=100,draw=gruen,line width=2pt] (30:1);
        \path[->] (node2) edge [out=200, in=80] (node3);
    \end{tikzpicture}

I can try until I have an approximate coordinate where the join happens, but that would be a problem if I want to change the position of the nodes later.

EDIT

I would like to have it that way:

X ------\
         -------> Z
Y ------/

Not the best sketch. But as percusse mentioned, the linked question should answer my question, too.

share|improve this question

marked as duplicate by percusse, Gonzalo Medina, Daniel, topskip, Harish Kumar Jun 13 '12 at 22:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
How do you want to proceed after join happens? Currently the line specs are different. You can use a temporary coordinate relative the target node for example at ($(node3)!1.5!(node3.70)$) and use it as a joining point. –  percusse Jun 13 '12 at 10:17
2  
Also related Merge arrows with TikZ –  percusse Jun 13 '12 at 10:18
add comment

2 Answers

up vote 2 down vote accepted

Thanks to percusse! I didn't find that question .. here is what my solution now looks like:

    \begin{tikzpicture}
        \tikzstyle{every node}=[draw,shape=ellipse];
        \node (node1) at (150:3) {x};
        \node (node2) at ( 30:3) {y};
        \node (node3) at ( 270:0) {z};

        \coordinate (zJoin) at ([yshift=0.5cm]node3.north);
        \draw[->] (zJoin) -- (node3); % the arrow

        \path (node1) edge [out=-20, in=100,draw=gruen,line width=2pt] (zJoin);
        \path (node2) edge [out=200, in=80] (zJoin);
    \end{tikzpicture}
share|improve this answer
    
No problem! Now that it is solved I've voted as a duplicate to the other linked question. –  percusse Jun 13 '12 at 11:50
add comment

You can select a specific point in a node where both arrows will join.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
 \begin{tikzpicture}
        \tikzstyle{every node}=[draw,shape=ellipse];
        \node (node1) at (150:3) {x};
        \node (node2) at ( 30:3) {y};
        \node (node3) at ( 270:0) {z};

        \path[->] (node1) edge [out=-20, in=100,draw=green,line width=2pt] (node3.north);
        \path[->] (node2) edge [out=200, in=80] (node3.north);
    \end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
    
Yes, that's correct. I forgot to mention that I would like to join before they reach the target. –  Bertram Nudelbach Jun 13 '12 at 10:53
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.