在 TikZ 中添加弯曲箭头

在 TikZ 中添加弯曲箭头

我正在使用 TikZ 绘制流程图。如何从第四个框向第二个框添加弯曲箭头,其中箭头应从框 4 的左侧开始?在此处输入图片描述

\begin{figure}
\centering
\begin{tikzpicture}[node distance=2cm]
\node (start) [startstop] {Start with a set of size $1$};
\node (in1) [startstop, below of=start] {Cycle over all considered input series};
 \node (in2) [startstop, below of=in1] {Select the input variable that resulted in the best RMS};
 \node (in3) [startstop, below of=in2] {Add the selected input variable series to the previous set};
 \draw [arrow] (start) -- (in1);
 \draw [arrow] (in1) -- (in2);
 \draw [arrow] (in2) -- (in3);
 \end{tikzpicture}
 \caption{Flow diagram showing the full steps used to construct the signal function.} 
 \label{fig:diagrama2}
 \end{figure}

答案1

与循环返回相比,它更容易绘制,特别是如果您受到 Se 上一些 LateX 专家的想法的启发,我会尽力简化您的代码:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains,positioning}

    \begin{document}
\begin{figure}
    \centering
    \begin{tikzpicture}[
                > = latex,
      start chain = going below,
every join/.style = {->,thick},
every node/.style = {draw, rounded corners, fill=red!30,
                     join, on chain},
                        ]
\node (start) {Start with a set of size $1$};
\node (in1)   {Cycle over all considered input series};
\node (in2)   {Select the input variable that resulted in the best RMS};
\node (in3)   {Add the selected input variable series to the previous set};
%
\draw[->,thick,rounded corners=3mm]% loop back from 4th block to the 2nd 
     (in3.west) -- + (-5mm,0mm)% intermediate coordinate, 
                               % 5mm left from the west border of 4th block 
                |- (in1.west);
 \end{tikzpicture}
 \caption{Flow diagram showing the full steps used to construct the signal function.}
 \label{fig:diagrama2}
\end{figure}
    \end{document}

在此处输入图片描述

相关内容