1

I have a flow diagram where text appears on the right of the arrow. I want to shift to the left of the arrow, is that possible?

enter image description here

\begin{center}

 \begin{tikzpicture}[auto,
    node distance = 3mm and 2mm,
      start chain = A going below,
       arr/.style = {-Stealth},
every edge/.style = {draw, arr},
        BC/.style = {decorate,  % Brace Calligraphic
                     decoration={calligraphic brace, amplitude=2mm,
                                 raise=1mm, mirror},
                     very thick, pen colour={black}
                    },
       box/.style = {draw, rounded corners, fill=blue!20, align=center,
                     minimum height=5ex, text width=5.5em},
  decision/.style = {diamond, aspect=1.5, draw, fill=blue!20,
                    inner xsep=-3pt, minimum width=5.4em, align=center},
    ellip/.style = { ellipse, aspect=1.5,draw, fill=blue!20,
                    inner xsep=-3pt, text width=5.4em, align=center},
                        ]
% nodes in chain
    \begin{scope}[nodes={on chain=A, join=by arr}]
\node   [box]     {start};         % name=A-1
\node   [box]       {end};

    \end{scope}

 \draw[arr] (A-1.south) -- node{This Text} (A-2.north);

\end{tikzpicture}
    \end{center}
0

1 Answer 1

1

In order to make the text next to the downward pointing arrow appear left of the arrow instead of on the right, you can use swap:

From the pgf manual:

enter image description here

enter image description here

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains, arrows.meta}
\begin{document}

\begin{center}

 \begin{tikzpicture}[auto,
    node distance = 3mm and 2mm,
      start chain = A going below,
       arr/.style = {-Stealth},
every edge/.style = {draw, arr},
        BC/.style = {decorate,  % Brace Calligraphic
                     decoration={calligraphic brace, amplitude=2mm,
                                 raise=1mm, mirror},
                     very thick, pen colour={black}
                    },
       box/.style = {draw, rounded corners, fill=blue!20, align=center,
                     minimum height=5ex, text width=5.5em},
  decision/.style = {diamond, aspect=1.5, draw, fill=blue!20,
                    inner xsep=-3pt, minimum width=5.4em, align=center},
    ellip/.style = { ellipse, aspect=1.5,draw, fill=blue!20,
                    inner xsep=-3pt, text width=5.4em, align=center},
                        ]
% nodes in chain
    \begin{scope}[nodes={on chain=A, join=by arr}]
\node   [box]     {start};         % name=A-1
\node   [box]       {end};

    \end{scope}

 \draw[arr, swap] (A-1.south) -- node{This Text} (A-2.north);

\end{tikzpicture}
    \end{center}


\end{document}
1
  • works like a charm. Thanks
    – gfdsal
    Oct 31, 2020 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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