0

I want to draw the following flowchart in latex (tikz package). Can someone please help in doing this job pleaseenter image description here

  • 3
    Could you show us what you have tried so far? – Raaja Feb 11 at 16:06
  • @Raaja i tried to update the following flowchart texample.net/tikz/examples/flowchart – user2869180 Feb 11 at 16:42
  • 1
    You might have more responses if you show what you tried (I mean the code updated by you, not the original source code from the link you gave)! – Vinzza Feb 11 at 17:16
2

There are numerous ways to draw such things, here is one.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,positioning,fit}
\begin{document}
\begin{tikzpicture}[data/.style={minimum height=1cm,minimum width=3cm,draw},
font=\sffamily,
% cf https://tex.stackexchange.com/a/175803/121799
apply data style to row/.style={row #1/.append style={nodes={data}}}]
 \matrix (mat) [matrix of nodes,column sep=0.2cm,row sep=2mm,
 apply data style to row/.list={2,3,5,6}
 ]{
 Load datasets & \hspace*{1cm} & Load datasets \\
 Data 1 & & Data 1 \\
 Data 2 & & Data 2 \\[5em]
  & & Load datasets\\
  & & Data 1 \\
  & & Data 2 \\
 };
 \foreach \X [count=\Z] in {(mat-1-1)(mat-3-1),(mat-1-3)(mat-3-3),(mat-4-3)(mat-6-3)}
 {\node[fit=\X,draw,inner ysep=6mm,yshift=-2.5mm,inner xsep=2mm] (F-\Z) {};
  \node[fill=white,draw] (L-\Z) at (F-\Z.south) {Result=Tuple};}
 \draw[-latex,blue] (F-1) -- (F-2);
 \draw[-latex,blue] (L-2) -- (F-3);
\end{tikzpicture}
\end{document}

enter image description here

As for your comment...

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{matrix,positioning}
\begin{document}
\begin{tikzpicture}[data/.style={minimum height=1cm,minimum width=4cm,draw},
font=\sffamily,
% cf https://tex.stackexchange.com/a/175803/121799
datamat/.style={matrix of nodes,column sep=0.2cm,row sep=2mm,
anchor=north,inner sep=3mm,
nodes={data},row 1/.append style={nodes={draw=none}},draw,
label={[anchor=center,draw,fill=white,name=label]below:#1}}]
\matrix (mat1) [datamat=Tuple]{
 Load datasets \\
 Data 1 \\
 Data 2 \\[1em]
 \\
 };
\matrix (mat2) [datamat=Tuple2,below right=0cm and 2cm of mat1.north east]{
 Load datasets \\
 Data 1 \\
 Data 2 \\
 Data 3 \\[1em]
 \\
 };
\matrix (mat3) [datamat=Tuple3,below=1cm of mat2]{
 Load datasets \\
 Data 1 \\
 Data 2 \\
 Data 3 \\
 Data 4 \\[1em]
 \\
 };
 \draw[-latex,blue,thick] (mat1) -- (mat1-|mat2.west);
 \draw[-latex,blue,thick] ([xshift=5mm]mat2.south west) -- ([xshift=5mm]mat3.north west);
\end{tikzpicture}
\end{document}

enter image description here

  • you solution is ok, but may be i was not to precise. Some boxes may contain different number of su-boxes (data1, data2, etc) and differents title (result=tuple). So please, how i can update you solution – user2869180 Feb 12 at 5:36
  • 1
    @bib I added a second proposal... – marmot Feb 12 at 5:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.