我无法绘制从底部开始,分别向左、向上、向右的箭头。我的问题是如何在流程图中添加该箭头。以下是 TeX 代码:
\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}
答案1
您可以在该路径左侧包含另一个点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}
答案2
两年后,题外话,使用最近的tikz
样式语法,为了有趣和练习:
\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 = {\def\tikz@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}