5

I'm very new to TikZ. I would like to join some nodes as shown in the attached image

enter image description here

I've got some idea from this thread tree rectangular. However, I could not manage to implement this properly with the arrow. I would appreciate if you share your comments/suggestion to implement this.

2
  • 1
    Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing what you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
    – jub0bs
    Commented Nov 1, 2013 at 23:39
  • @Jubobs thanks for your comment. Actually, I could only produced the three nodes at the left column, so was not sure if that'll be useful to show or not. But I got your point and I'll try to put my question with a MWE.
    – rana
    Commented Nov 2, 2013 at 9:06

2 Answers 2

6

Complicate the coding to make it easier to understand.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\tikzset{
    block/.style = {draw,rectangle,minimum size=1cm,rounded corners = 1ex,thick}}
\begin{document}

\begin{tikzpicture}
%% first column
\node [block,draw=blue] (1a) {};
\node [block,draw=blue,below = 1cm of 1a] (1b) {};
\node [block,draw=blue,below = 1cm of 1b] (1c) {};
%% second column
\node [block,draw=green!70!blue,below right = 0cm and 2cm of 1a] (2a) {};
\node [block,draw=green!70!blue,below = 1cm of 2a] (2b) {};
%% paths
\draw[thick,magenta] (1a.-20) -| ([xshift=-1cm]2a.west)coordinate (a);
\draw[thick,magenta] (a) |- (1b.20);
\draw[thick,blue!60!green,-latex] (a) |- (2a.west);
\draw[thick,magenta] (1b.-20) -| ([xshift=-1cm]2b.west)coordinate (b);
\draw[thick,magenta] (b) |- (1c.20);
\draw[thick,blue!60!green,-latex] (b) |- (2b.west);

\end{tikzpicture}
\end{document}

enter image description here

3
  • thanks for your reply. I could implement this in my code now. I was wondering if you are aware of any tutorial/site on TikZ for the beginners.
    – rana
    Commented Nov 2, 2013 at 11:08
  • @rana Go to texexample.net. You can use those to learn new stuff. :D
    – Alenanno
    Commented Nov 2, 2013 at 12:02
  • @rana: pgfmanual is the best resource. texdoc pgfmanual from command line/prompt.
    – user11232
    Commented Nov 6, 2013 at 22:07
2

An other alternative via matrix node from TiKZ

enter image description here

Code:

    \documentclass{article}
    \usepackage{tikz}
    \usetikzlibrary{shapes,arrows,positioning,scopes}

    \begin{document}
    \tikzset{%
    line/.style={draw, thick},
    point/.style={coordinate},
    boxes/.style={draw, rectangle,
                thick,minimum height=2cm, rounded corners,
                minimum width=1cm, text=black, thick,
                text width=25mm,  align=center}
}
    \begin{tikzpicture}[scale=1]
    % Place nodes
    \matrix[column sep=1cm, row sep=0.5cm]{
    \node [boxes,blue] (1a){}; &                    &                             \\
                               & \node[point](d){}  &\node[boxes,green] (3a){};   \\  
    \node [boxes,blue] (1b){}; &                    &                             \\
                               & \node[point](e){}; &\node[boxes,green] (3b){};   \\
    \node [boxes,blue] (1c){}; &                    &                             \\
    }; 
    % Draw edges
    \path [line,magenta] ([shift={(0cm,-0.3cm)}]1a.east) -| (d) |- ([shift={(0cm,0.3cm)}]1b.east) ;
    \path [line, -latex',blue!60!green] (d.east) -- (3a.west);
    \path[line,magenta] ([shift={(0cm,-0.3cm)}]1b.east) -| (e) |- ([shift={(0cm,0.3cm)}]1c.east);
    \path [line, -latex',blue!60!green] (e.east) -- (3b.west);
    \end{tikzpicture}
    \end{document}
1
  • thanks for your reply. I was not aware of this more structured format.
    – rana
    Commented Nov 2, 2013 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .