I'm trying to draw a flow diagram using TikZ.
I would like that the wording in the arrows appeared either left or right of the path, instead of on top of the arrows. I also tried to work around this using node opacity and style={fill=white}
but it didn't work.
Also I managed to position the nodes the way I intended to, but I'm sure there are many easier ways to do this. I saw stuff like the matrix
library and layered layouts, but couldn't implement it successfully.
Lastly, I would like to have an arrow like the one I drew manually in the picture. I tried using controls, but the results are not quite what I intended because the arrow crosses some nodes.
Thank you very much for your support.
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\scalebox{0.6}[0.6]{
\begin{tikzpicture}
[>=stealth, place/.style={shape=rectangle,draw,rounded corners,fill=blue!25,},trans/.style={align=center},auto,scale=3]
\node[place] (a1) {Input};
\node[trans,right=2cm of a1] (b1) {Replicate};
\node[place,right=2.05cm of b1] (c1) {Working};
\node[below=0.5cm of b1 ,shape=rectangle,draw,rounded corners,fill=red!25,inner sep=4] (a2) {\LARGE \centering Imputation Step Iteration 1};
\node[place,below=1.75cm of a1] (a3) {Input};
\node[place,below=1.75cm of c1] (b3) {Working};
\node[trans,below=0.6cm of a3] (a4) {\footnotesize SSCPMISS};
\node[trans,below=0.5cm of b3,] (b4) {Replicate};
\node[shape=rectangle,draw,rounded corners,fill=blue!25,align=center,below=0.6cm of a4] (a5) {SSCP};
\node[rectangle,draw,rounded corners,fill=green!25,inner sep=8, right=0.6cm of a5] (b5) {\Large Imputation: 1\textsuperscript{st} row};
\node[place,below=0.55cm of b4,] (c5) {Output};
\node[place, below=0.5cm of b5] (a6) {Output};
\node[trans, below=0.5cm of a6] (a7) {Copy imputed values for every row};
\node[place, below=0.5cm of a7] (a8) {Output};
\node[rectangle,draw,rounded corners,fill=green!25,inner sep=8, below=0.5cm of a8] (a9) {\Large Imputation: PXXXX\_O};
\node[place, below=0.5cm of a9] (c10) {Output};
\node[trans, left=0.5cm of c10] (b10) {Output N \\=\\ Input N+1};
\node[place, left=0.5cm of b10] (a10) {Input};
\node[trans, right=0.5cm of c10] (d10) {Save \\ iteration\\ output};
\node[place, right=0.8cm of d10] (e10) {Output\_1};
\node[below=1cm of c10 ,shape=rectangle,draw,rounded corners,fill=red!25,inner sep=4] (a11) {\LARGE \centering Imputation Step Iteration 2};
\node[place,below=13cm of c1] (b12) {Working};
\node[place,below=13cm of a1] (a12) {Input};
%
\draw [->,] (a1) -- (c1);
\draw [->,] (a1) -- (a2);
\draw [->,] (c1) -- (a2);
\draw [->,] (a3) -- (a5);
\draw [->,] (b3) -- (c5);
\draw [->,] (a5) -- (b5);
\draw [->,] (c5) -- (b5);
\draw [->,] (b5) -- (a6);
\draw [->,] (a6) -- (a8);
\draw [->,] (a8) -- (a9);
\draw [->,] (a9) -- (c10);
\draw [->,] (c10) -- (a10);
\draw [->,] (c10) -- (e10);
\draw [->,] (a10) |- (a11);
\end{tikzpicture}
}
\end{document}
midway
. For the curved arrow, there are many options:controls
,to
,plot coordinates
, etc.midway
worked nicely to bypass the text on top of arrow problem. About starting with thea2
node: I din't just because I needed to show that Input and working are basically the same on iteration 1.e10
as control for the arrow I want? If so, could you please show me?controls
, butto
.