首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用方形连接绘制流程图

用方形连接绘制流程图
EN

Stack Overflow用户
提问于 2020-04-10 22:19:54
回答 1查看 113关注 0票数 0

我试着在提供的链接上画一个图,从“行为”到流程图开头的菱形决策,但我失败了。我想画一个连接箭头从方块到菱形,而不跨越其他方块。有人能帮我做这件事吗?

https://www.overleaf.com/1327913296kgkmkvmhqgmj

向布鲁诺致以最美好的问候

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-10 23:03:26

如果我理解weel,也许添加一些隐藏节点可能会有一些帮助:

代码语言:javascript
复制
\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}

我对隐藏的节点使用了一些有趣的名称,您可能会发现一些更重要的东西。

编辑:我编辑了最后一行,因此角不再丢失。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61142254

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档