TransWikia.com

Left-up arrow in flowchart

TeX - LaTeX Asked by Rageful on February 22, 2021

I can’t draw an arrow that starts from bottom, goes to left, up, right, respectively. My question is how can I add that arrow in the flowchart. Here is the TeX code:

documentclass[11pt,a4paper,oneside]{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{siunitx}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage{tikz}
usetikzlibrary{patterns}
usepackage{caption}
usetikzlibrary{arrows}
usepackage{color}
usepackage[colorlinks]{hyperref}
usepackage{pgfplots}
usepackage{listings}
usepackage[utf8]{inputenc}
usetikzlibrary{shapes.geometric}

begin{document}
section*{Flowchart}
tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm,minimum height=1cm,text centered, draw=black, fill=red!30]
tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=blue!30]
tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
tikzstyle{arrow} = [thick,->,>=stealth]

begin{tikzpicture}[node distance=2cm]
node (start) [startstop] {Başla};
node (pro1) [process, below of=start, yshift=+0.2cm] {$rho(T)$, $ c_{p}(T)$, $ k(T)$, $mu(T)$ hesapla};
node (io1) [io, below of=pro1] {$T_{g}=SI{29}{celsius}$, $T_{f}=SI{31}{celsius}$, $T_{w}=SI{35}{celsius}$ };
node (pro2) [process, below of=io1, yshift=-0.2cm] {$h_{r,w-g}$, $Pr_{gf}$, $Pr_{wr}$, $Gr_{gf}$, $Gr_{wr}$, $Ra_{gf}$, $Ra_{wr}$ hesapla};
node (dec1) [decision, below of=pro2, yshift=-1cm] {$Ra_{L}leq10^{9}$};
node (pro2a) [process, below of=dec1, yshift=-0.5cm] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, $h_{w}$, $h_{r}$, $U_{t}$, $U_{b}$ hesapla};
node (pro2b) [process, right of=dec1, xshift=2cm] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, $h_{w}$, $h_{r}$, $U_{t}$, $U_{b}$ hesapla};
node (pro3a) [process, below of=pro2a] {AX=B matrisini oluştur ve çöz};
node (stop) [startstop, below of=pro3a] {Stop};
% Arrows
draw [arrow] (start) -- (pro1);
draw [arrow] (pro1) -- (io1);
draw [arrow] (io1) -- (pro2);
draw [arrow] (pro2) -- (dec1);
draw [arrow] (dec1) -- node[anchor=east] {evet} (pro2a);
draw [arrow] (dec1) -- node[anchor=south] {hayır} (pro2b);
draw [arrow] (pro2b) |- (pro3a);
draw [arrow] (pro2a) -- (pro3a);
draw [arrow] (pro3a) -| (io1);
draw [arrow] (pro3a) -- (stop);
end{tikzpicture}
end{document}

Here is the arrow that I want to add.

2 Answers

You can include another point in that path that lies left of pro3a:

documentclass[11pt,a4paper,oneside]{article}
usepackage{amsmath}
usepackage{amssymb}
usepackage{graphicx}
usepackage{siunitx}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}
usepackage{tikz}
usetikzlibrary{patterns}
usepackage{caption}
usetikzlibrary{arrows}
usepackage{color}
usepackage[colorlinks]{hyperref}
usepackage{pgfplots}
usepackage{listings}
usepackage[utf8]{inputenc}
usetikzlibrary{shapes.geometric}

begin{document}
section*{Flowchart}
tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm,minimum height=1cm,text centered, draw=black, fill=red!30]
tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=blue!30]
tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]
tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
tikzstyle{arrow} = [thick,->,>=stealth]

begin{tikzpicture}[node distance=2cm]
node (start) [startstop] {Başla};
node (pro1) [process, below of=start, yshift=+0.2cm] {$rho(T)$, $ c_{p}(T)$, $ k(T)$, $mu(T)$ hesapla};
node (io1) [io, below of=pro1] {$T_{g}=SI{29}{celsius}$, $T_{f}=SI{31}{celsius}$, $T_{w}=SI{35}{celsius}$ };
node (pro2) [process, below of=io1, yshift=-0.2cm] {$h_{r,w-g}$, $Pr_{gf}$, $Pr_{wr}$, $Gr_{gf}$, $Gr_{wr}$, $Ra_{gf}$, $Ra_{wr}$ hesapla};
node (dec1) [decision, below of=pro2, yshift=-1cm] {$Ra_{L}leq10^{9}$};
node (pro2a) [process, below of=dec1, yshift=-0.5cm] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, $h_{w}$, $h_{r}$, $U_{t}$, $U_{b}$ hesapla};
node (pro2b) [process, right of=dec1, xshift=2cm] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, $h_{w}$, $h_{r}$, $U_{t}$, $U_{b}$ hesapla};
node (pro3a) [process, below of=pro2a] {AX=B matrisini oluştur ve çöz};
node (stop) [startstop, below of=pro3a] {Stop};
% Arrows
draw [arrow] (start) -- (pro1);
draw [arrow] (pro1) -- (io1);
draw [arrow] (io1) -- (pro2);
draw [arrow] (pro2) -- (dec1);
draw [arrow] (dec1) -- node[anchor=east] {evet} (pro2a);
draw [arrow] (dec1) -- node[anchor=south] {hayır} (pro2b);
draw [arrow] (pro2b) |- (pro3a);
draw [arrow] (pro2a) -- (pro3a);
draw [arrow] (pro3a) -- +(-4,0) |- (io1);
draw [arrow] (pro3a) -- (stop);
end{tikzpicture}
end{document}

enter image description here

Correct answer by Skillmon on February 22, 2021

After two years, off-topic, with use of the recent tikz styles syntax, for fun and exercise:


documentclass[11pt,a4paper,oneside]{article}
usepackage[a4paper,left=3cm,right=2cm,top=2.5cm,bottom=2.5cm]{geometry}

usepackage{amsmath, bm}
usepackage{listings}
usepackage{graphicx}
usepackage{siunitx}
usepackage{caption}

usepackage{pgfplots}
pgfplotsset{compat=1.17}
usetikzlibrary{arrows.meta,
                chains,
                positioning,
                quotes,
                shapes.geometric}

usepackage[colorlinks]{hyperref} % had to be loaded last
makeatletter
tikzset{FlowChart/.style={
     base/.style = {draw, rounded corners,
                    minimum width=32mm, minimum height=11mm, align=center,
                    on chain, join=by arr},
startstop/.style = {base, fill=red!30},
  process/.style = {base, fill=orange!30,
                    text width=54mm},
 decision/.style = {diamond, aspect=1.3, draw, fill=green!30,
                    minimum width=3cm, minimum height=1cm, align=center,
                    on chain, join=by arr},
       io/.style = {trapezium, trapezium stretches body,
                    trapezium left angle=70, trapezium right angle=110,
                    draw, fill=blue!30,
                    minimum width=54mm, minimum height=1cm,
                    text width =pgfkeysvalueof{/pgf/minimum width}-2*pgfkeysvalueof{/pgf/inner xsep},
                    align=center,
                    on chain, join=by arr},
      arr/.style = {draw, semithick, -Triangle},
suspend join/.code = {deftikz@after@path{}}
        }   }
makeatother

begin{document}
section*{Flowchart}

    begin{tikzpicture}[FlowChart, auto,
    node distance = 5mm and 17mm,
      start chain = A going below
                        ]
node (start) [startstop] {Başla};
node (pro1)  [process] {$rho(T)$, $ c_{p}(T)$, $ k(T)$, $mu(T)$ hesapla};
node (io1)   [io] {$begin{aligned}    
                        T_{g} & = SI{29}{celsius}[-0.5ex] 
                        T_{f} & = SI{31}{celsius}[-0.5ex] 
                        T_{w} & = SI{35}{celsius}
                     end{aligned}$ };
node (pro2)  [process] {$h_{r,w-g}$, $Pr_{gf}$, $Pr_{wr}$, 
                         $Gr_{gf}$,   $Gr_{wr}$, $Ra_{gf}$, 
                         $Ra_{wr}$ hesapla};
node (dec1)  [decision] {$Ra_{L}leq10^{9}$};
node (pro2a) [process] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, $h_{w}$, $h_{r}$, $U_{t}$, $U_{b}$ hesapla};
node (pro3a) [process] {$bf{AX}=bf{B}quad$
                         matrisini oluştur ve çöz};
node (stop)  [startstop] {Stop};
%
node (pro2b) [process, suspend join, 
               right= of dec1.east] {$Nu_{gf}$, $Nu_{wr}$, $h_{g}$, 
                                     $h_{w}$,  $h_{r}$,   $U_{t}$, 
                                     $U_{b}$ hesapla};
% Arrows and labels not included in join maro
draw[arr]  (dec1) to [pos=0.3,"evet"] (pro2a) 
            (dec1) to ["hayır"] (pro2b);
draw [arr] (pro2b) |- (pro3a);
draw [arr] (pro3a) -- +(-4,0) |- (io1);
end{tikzpicture}
end{document}

enter image description here

Answered by Zarko on February 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP