6

Would like to include PRISMA flowchart in my study and I might need help on setting up my tikzpicture commands. Any help is much appreciated. Thanks

enter image description here

  • 3
    What did you try until now? I presume you already looked for flow chart in TeX.SX and I'm sure you found a lot of information. So, what's your particular question? – Ignasi Aug 29 '15 at 8:00
12

Here is a possible solution using the tikz positioning and chains libraries:

enter image description here

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{positioning,chains}

\begin{document}

\tikzset{
    mynode/.style={
        draw, rectangle, align=center, text width=5cm, font=\small, inner sep=3ex},
    mylabel/.style={
        draw, rectangle, align=center, rounded corners, font=\small\bf, inner sep=2ex, 
        fill=cyan!30, minimum height=3.8cm},
    arrow/.style={
        very thick,->,>=stealth}
}

\begin{tikzpicture}[
    node distance=1.5cm,
    start chain=1 going below,
    every join/.style=arrow,
    ]
    % the chain in the center going below
    \coordinate[on chain=1] (tc);
    \node[mynode, on chain=1] (n2)
        {\# of records after duplicates removed};
    \node[mynode, join, on chain=1] (n3)
        {\# of records screened};
    \node[mynode, join, on chain=1] (n4)
        {\# of full-text articles accessed for eligbility};
    \node[mynode, join, on chain=1] (n5)
        {\# of studies included in qualitative synthesis};
    \node[mynode, join, on chain=1] (n6)
        {\# of studies included in quantitative sysntesis\\ (meta-analysis)};

    % the branches to the right
    \begin{scope}[start chain=going right]
        \chainin (n3);
        \node[mynode, join, on chain]
            {\# of records excluded};
        \chainin (n4);
        \node[mynode, join, on chain]
            {\# of full-text articles excluded, with reasons};
    \end{scope}

    % the nodes at the top  
    \node[mynode, left=1cm of tc, anchor=south east] (n1l)
        {\# of records is identified through database searching};
    \node[mynode, right=1cm of tc, anchor=south west] (n1r) 
        {\# of additional records indentified\\ through other sources};

    \coordinate (n2nl) at ([xshift=-2cm]n2.north);
    \coordinate (n2nr) at ([xshift= 2cm]n2.north);
    \draw[arrow] (n1l.south -| n2nl) -- (n2nl);
    \draw[arrow] (n1r.south -| n2nr) -- (n2nr);

    % the labels on the left
    \begin{scope}[start chain=going below, xshift=-8cm, node distance=.8cm]
        \node[mylabel, on chain] {\rotatebox{90}{Identification}};
        \node[mylabel, on chain] {\rotatebox{90}{Screening}};
        \node[mylabel, on chain] {\rotatebox{90}{Eligibility}};
        \node[mylabel, on chain] {\rotatebox{90}{Included}};
    \end{scope}

    % the title
    \node[above=2.5cm of tc, font=\bf] {PRISMA 2009 Flow Diagram};
\end{tikzpicture}
\end{document}
8

Slightly modified (simplyfied) @Sergej solution:

\documentclass[border=2mm,
               tikz,
               preview]{standalone}
\usetikzlibrary{positioning,chains}

\begin{document}

\begin{tikzpicture}[
    node distance=15mm and 10mm,
    start chain=going below,
 mynode/.style = {
        draw, rectangle, align=center, text width=5cm,
        font=\small, inner sep=3ex, outer sep=0pt,
        on chain},
mylabel/.style = {
        draw, rectangle, align=center, rounded corners, 
        font=\small\bfseries, inner sep=2ex, outer sep=0pt,
        fill=cyan!30, minimum height=38mm,
        on chain},
every join/.style = arrow,
     arrow/.style = {very thick,-stealth}
                    ] 
\coordinate (tc);
% the title
\node[above=of tc,font=\bfseries] {PRISMA 2009 Flow Diagram};
% the nodes at the top
\node (n1a) [mynode, left=of tc]    {\# of records is identified 
                                        through database searching};
\node (n1b) [mynode,right=of tc]    {\# of additional records indentified\\
                                        through other sources};
    % the chain in the center
\node (n2)  [mynode, below=of tc]   {\# of records after duplicates removed};
\node (n3)  [mynode,join]   {\# of additional records indentified\\
                                        through other sources};
\node (n4)  [mynode,join]   {\# of full-text articles accessed 
                                            for eligibility};
\node (n5)  [mynode,join]   {\# of studies included in qualitative synthesis};
\node (n6)  [mynode,join]   {\# of studies included in quantitative sysntesis\\
                                (meta-analysis)};
% the branches to the right
\node (n3r) [mynode,right=of n3]    {\# of records excluded};
\node (n4r) [mynode,right=of n4]    {\# of full-text articles excluded,
                                        with reasons};
% lines not included in join                                        
\draw[arrow] ([xshift=+22mm] n1a.south) coordinate (a)
                                       -- (a |- n2.north);
\draw[arrow] ([xshift=-22mm] n1b.south) coordinate (b)
                                       -- (b |- n2.north);
\draw[arrow] (n3) -- (n3r);
\draw[arrow] (n4) -- (n4r);
% the labels on the left
    \begin{scope}[node distance=7mm]
\node[mylabel,below left=-3mm and 11mm of n1a.north west]
                {\rotatebox{90}{Identification}};
\node[mylabel]  {\rotatebox{90}{Screening}};
\node[mylabel]  {\rotatebox{90}{Eligibility}};
\node[mylabel]  {\rotatebox{90}{Included}};
    \end{scope}
\end{tikzpicture}
\end{document}
  • Zarko, have a blessed day – user28251 Aug 29 '15 at 13:49
  • Both solutions look complicated for me. ;) What is simplified in the second one? – buhtz Jan 11 '16 at 19:28
  • 1
    Good question (regarding differences between answers)! As far as I now see, on chain is not repeated in each node in chain. Maybe is in it some more small differences (as stated in answer). If you will read TikZ manual, you will see, that both answers are relatively simple, and in MWE are comments, which explains, to which part of images particular fragment of code belongs. Of course, you can draw this flowchart more directly, without used capabilities of TikZ libraries, which are used in both answers. Consequently code will not be so concise as presented here. – Zarko Jan 11 '16 at 19:44
  • I got a bit deeper on both answers here. I don't like them. ;) To much explicite positioning using mm and things like that. I would like to make it more relative and flexible. E.g. The PRISMA-nodes should know themselfs to which of the blue-nodes in the left they belong to. – buhtz Jan 28 '16 at 14:31
  • 1
    I will checkyour new question in evening. – Zarko Jan 28 '16 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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