Could anyone help me create a tikzpicture using nodes The picture I want and the code I have so far are shown below. There are two things I'm struggling with: First, how to make two arrows coming out of the last rectangle? Second, how to add that switch element between the circle and the first rectangle?
% Tikz block diagram for the product processor
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{decorations.shapes}
\usetikzlibrary{calc}
% Definition of styles for blocks and multiplier
\tikzstyle{block} = [rectangle, draw=black, thick, text width=2em,align=center,
minimum height=2em, node distance=8em]
\tikzstyle{mult}=[draw=black, thick, circle, node distance = 2cm] % multiplier
%-----------------------------------------------------------------------
\begin{document}
\begin{tikzpicture}[font=\sffamily, >=latex]
\node [align=center,color=black] at (-2,-1) (snlabel) {$c$};
\node[circle, draw,node distance=5em, right of=snlabel, color=black] (circlelabel1){$\times$};
\node[block, right of=circlelabel1, color=black, node distance=5em] (sumlabel) {text1};
\node[block, right of=sumlabel, color=black, node distance=7em] (detlabel) {$d=e$\\$f=g$};
\draw[->, color=black] (snlabel) -- node [above] {}(circlelabel1);
\draw[->, color=black] (circlelabel1) -- node [above] {} (sumlabel);
\draw[->, color=black] (sumlabel) -- node [above] {\color{black} $b$} (detlabel);
% add whitespace to bottom and top
\node at (4.5,-3.5) {\hspace*{1em}};
\node at (4.5,-.4) {\hspace*{1em}};
\end{tikzpicture}
\end{document}
Best Answer
I strongly recommend the
positioning
library and the usageright=of A
notright of=A
. Also, note the use oftikzset
for defining styles;\tikzstyle
should no longer be used.