具有多个输出块的流程图的自动对齐

具有多个输出块的流程图的自动对齐

流程图自动对齐

如果块中的文本“吹”了它并且它的尺寸开始干扰其他块,如何进行自动对齐(并具有多个输出块,例如 a、b、y)。

在此处输入图片描述

\documentclass[tikz,a4paper,border=1mm]{standalone}

\usepackage{pgfplots}
\usepackage{amsmath}

\usetikzlibrary{positioning,arrows}

\begin{document}

\tikzset{%
    block/.style={draw, fill=white, rectangle, 
            minimum height=2em, minimum width=3em},
    input/.style={inner sep=0pt},       
    output/.style={inner sep=0pt},      
    sum/.style = {draw, fill=white, circle, minimum size=2mm, node distance=1.5cm, inner sep=0pt},
    pinstyle/.style = {pin edge={to-,thin,black}}
}

\begin{tikzpicture}[auto, node distance=1cm, >=latex']

\node[input] (input) {};
\node[input, above = of input] (input1) {};
\node [sum, right = of input] (sum) {};
\node [block, right = of sum] (system) {$\begin{cases}  \dot{\vec{x}}_i=f_i(\vec{x}_i,t)+g_i(\vec{x}_i,t)u(t) \\ y=h_i(\vec{x}_i,t)\end{cases}$};
\node [output, right = of system] (output) {};
\node [output, above = of output] (output1) {};
\node [block, below = of system] (controller) {$K(s)$};

\draw [draw,->] (input) node[above right] {$0$} -- (sum);
\draw [->] (sum) -- node {$e_{i}$} (system);
\draw [->] (system) -- (output) node [name=q, above left] {$y$};

\draw [->] ([xshift=-5mm]q.south) |- node {$x$} (controller);

\draw [->] (controller) -| node[pos=0.99, right] {$-$} 
    node [pos=.25, above] {$s$} (sum);


\end{tikzpicture}
\end{document}

答案1

根据我的第二个例子回答关于你之前的问题:

\documentclass[preview, border=3.141592mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                chains,
                positioning,
                quotes}
\tikzset{cntrl/.style = {
            > = Stealth,
node distance = 4mm and 8mm,
   box/.style = {draw, minimum size=7mm},
     C/.style = {circle, draw, minimum size=4mm},
   dot/.style = {circle, fill, inner sep=2pt, node contents={}},
every edge/.append style = {draw, ->},
  start chain
        }   }
\usepackage{amsmath}

\begin{document}
    \begin{tikzpicture}[cntrl]
    \begin{scope}[nodes={on chain=going right}]
\coordinate (in) {};
\node   (sum)       [C]     {};
\node   (system)    [box]   {$\begin{cases}
                        \dot{\vec{x}}_i = f_i(\vec{x}_i,t)+g_i(\vec{x}_i,t)u(t) \\
                                      y = h_i(\vec{x}_i,t)
                              \end{cases}$};
\coordinate (aux);
\coordinate (b);
    \end{scope}
\node(filter)   [box, below=of system] {$K(s)$};
%
\coordinate[above right=of aux]   (a);
\coordinate[below right=of aux]   (out);
\node (dot)  [dot,at={(aux |- out)}];
\draw   (in)    edge["$s_{i-1}$"]   (sum)
        (sum)   edge["$e_{i}$"]     (system);
\draw[->]   (system.east |- a)   -- (a)   node[right] {$a$};
\draw[->]   (system.east |- b)   -- (b)   node[right] {$b$} ;
\draw[->]   (system.east |- out) -- (out) node[right] {$q_{i}$};
%
\draw[->]   (dot)    |- (filter.east)   node[above right]   {$x$};
\draw[->]   (filter) -| (sum)           node[pos=0.25,above] {$s$}
                                        node[below right]   {$-$};
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容