5

Possible Duplicate:
How to draw a Sankey Diagram using TikZ

I want to have an arrow which splits up and one end is pointing then downwards. When you compile the code below you should see my progress by far. I couldn't upload an image and ascii art is not my field of talent.

enter image description here

But when you see the picture, you can obviously see my problem. My code looks like this:

\documentclass[tightpage]{standalone}
\usepackage[pdftex,active,tightpage]{preview}
\usepackage{varwidth}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usetikzlibrary{arrows}

\begin{document}
  \begin{preview}
    \begin{varwidth}{20\linewidth}
      \newcommand{\splitarrow}[3] {
        \node[inner sep=0pt] (thirdnode) at ($ (#1.east)!.333!(#2.west) $) {};
        \node (twothirdnode) at ($ (#1.east)!.666!(#2.west) $) {};
        \node (twothirdbelownode) [below=2em of twothirdnode] {#3};
        \draw[line width=2ex] (#1.east) -- (thirdnode.center);
        \draw[line width=1.5ex,-triangle 90 cap] 
          ([yshift=0.25ex]thirdnode.center) -- ([yshift=0.25ex]#2.west);
        \draw[line width=0.5ex,-fast cap,draw=red] 
          ([yshift=-0.75ex]thirdnode.center) to[bend angle=45,bend left] 
            (twothirdbelownode.north);
      }

      \begin{tikzpicture}
        \node (nodeleft)  {};
        \node (noderight) [right=3em of nodeleft.west] {};
        \splitarrow{nodeleft}{noderight}{$\eta$};
      \end{tikzpicture}
    \end{varwidth}
  \end{preview}
\end{document}

Thanks for any help! Cheers Reza

Edit:

Did some better picture:

enter image description here

here the code:

\newcommand{\splitarrow}[3] {
  \node (twothirdnode) at ($ (#1.east)!.666!(#2.west) $) {};
  \node (twothirdbelownode) [below=2cm of twothirdnode] {#3};
  \draw[line width=1cm,-triangle 90 cap] ([yshift=0.75cm]#1.east) -- 
    ([yshift=0.75cm]#2.west);
  \draw[line width=0.5cm,rounded corners=20pt,-fast cap] (#1.east) -| 
    (twothirdbelownode);
}
Reza
  • 1,798
  • Try setting out=0, in=90 instead of bend angle=45,bend left. Is that what you're trying to achieve? – Jake Nov 06 '12 at 12:58
  • 1
    You can upload the image but then remove the ! in the markup inserted, someone with edit privilege would put the ! back. – David Carlisle Nov 06 '12 at 13:01
  • Ok, I inserted the picture. Looks a lot better. Is there an easier way to achieve the same? – Reza Nov 06 '12 at 13:01
  • Easier in what way? – Jake Nov 06 '12 at 13:06
  • Less code and a cleverer use of the tikz features. – Reza Nov 06 '12 at 13:11
  • @Reza: Do you mean your whole figure, or just getting the bend right for the lower arrow? You should probably edit your question to be more explicit about what kind of answer you're looking for (do you just want to provide three coordinates and the ratio of arrow thicknesses, for example?). – Jake Nov 06 '12 at 13:18
  • yes, I want to provide the 2 coordinates and a ratio in which the arrow should be split up. The thickness of the main line should be something like 1/10 of the distance between the two delivered coordinates. – Reza Nov 06 '12 at 13:29
  • 1

0 Answers0