latex - 使用平方连接绘制流程图
问题描述
我尝试在流程图开头从“行为”到决策菱形提供的链接上绘制图表,但我失败了。我想画一个从方块到菱形的连接箭头而不穿过其他方块。有人可以帮我做吗?
https://www.overleaf.com/1327913296kgkmkvmhqgmj
最好的问候布鲁诺
解决方案
如果我理解 weel,也许添加一些隐藏节点可能会有所帮助:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usepackage{csquotes}
\usetikzlibrary{shapes,arrows}
\input{config}
\begin{document}
\begin{figure}[!htp]
\centering
\begin{tikzpicture}[node distance = 2cm, auto]
% Place nodes
\node [cloud] (init) {Initialize};
\node [block, left of = init, node distance = 4cm] (estimate) {Estimate};
\node [block, below of = estimate, node distance = 3cm] (compute) {Compute};
\node [decision, below of = init] (decide_exploration) {$t \in (t_i, \, t_{i+1})$?};
\node [decision, below of = decide_exploration, node distance = 4cm] (decide_sample) {$t_s \in (t_s^0, \, t_s^0 + T_s)$?};
\node [block, right of = decide_sample, node distance = 4cm] (sample) {Sample};
\node [block, below of = decide_sample, node distance = 4cm] (control) {Act};
\node [below of = control, node distance = 2cm] (control2) {};
\node [right of = control2, node distance = 6cm] (control3) {};
\node [right of = decide_exploration, node distance = 2cm] (sample2) {};
% Draw edges
\path [line, dashed] (init) -- (estimate);
\path [line] (estimate) -- (compute);
\path [line] (compute) |- (control);
\path [line] (decide_exploration) -- node {yes} (decide_sample);
\path [line] (decide_exploration) -- node {no} (estimate);
\path [line] (decide_sample) -- node {yes} (control);
\path [line] (decide_sample) -- node {no} (sample);
\path [line] (sample) |- (control);
\path [line] (control) |-(6,-13) |-(sample2) |-(decide_exploration);
\end{tikzpicture}
\caption{Source seeking algorithm}
\label{fig:sseeking_algo}
\end{figure}
\end{document}
我为隐藏节点使用了一些有趣的名称,您可能会发现更重要的东西..
编辑:我编辑了最后一行,所以角落不再丢失。
推荐阅读
- maven - 空手道是否支持 -Dsurefire.rerunFailingTestsCount 在 Jenkins 中重新运行失败的测试
- curl - 使用用户名:密码语法进行卷曲 FTPS 上传
- flutter - 如何删除飞镖中的可选实例变量?
- java - Android Room - 如何在插入之前检查同名实体是否已存在?
- c++ - 如何在有条件的情况下计算 3d 网格中从一个点到另一个点的所有路径
- scala - 类似于函数式Scala中的for循环
- java - 如何将我的代码分解为子例程 - Java
- r - 如何循环日期?
- javascript - 使用 JavaScript,我将如何编写“如果下一个兄弟姐妹具有特定的类名 xxx,则执行此操作,否则执行此操作”?
- c++ - C++ - 为什么我的程序在再次调用函数后关闭?