How can I shift the system
node right of control1
but vertically centered between control1
and control2
?
\tikzstyle{controller} = [draw, fill=blue!20, rectangle,
minimum height=3em, minimum width=6em]
\tikzstyle{block} = [draw, fill=yellow!20, rectangle,
minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, circle, node distance=1.5cm]
\tikzstyle{disturbance} = [draw=none, node distance=1.5cm, line width=0pt]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [controller, right of=sum] (control1){Control1};
\node [controller, above of=control1] (control2) {Control2};
\node [block, right of= control1, node distance=5cm, yshift=-1.4cm] (system) {System};
Best Answer
You can use
positioning
library instead of the deprecated input syntax<direction> of =
. See this answer Difference between "right of=" and "right=of" in PGF/TikZ and also Should \tikzset or \tikzstyle be used to define TikZ styles?Then, you can use the
calc
syntax to get the middle point of the two nodes.And please post full compilable code.