LaTeX forum ⇒ Graphics, Figures & TablesBranching Arrows with Decision Option in Flowchart Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
mayankmi
Posts: 45
Joined: Sat Apr 20, 2013 7:52 pm

Branching Arrows with Decision Option in Flowchart

Postby mayankmi » Sun Oct 20, 2013 12:09 pm

Hey,

I just want to bifurcate arrows with yes no options as shown in figure attached. My sample code is given below.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{tikz}
  4. \usetikzlibrary{arrows,trees}
  5.  
  6. \tikzstyle{intt}=[draw,text centered,minimum size=6em,text width=5.25cm,text height=0.34cm]
  7. \tikzstyle{intl}=[draw,text centered,minimum size=2em,text width=2.75cm,text height=0.34cm]
  8. \tikzstyle{int}=[draw,minimum size=2.5em,text centered,text width=3.5cm]
  9. \tikzstyle{intg}=[draw,minimum size=3em,text centered,text width=6.cm]
  10. \tikzstyle{sum}=[draw,shape=circle,inner sep=2pt,text centered, node distance=3.5cm]
  11. \tikzstyle{summ}=[draw,shape=circle,inner sep=4pt,text centered, node distance=3.cm]
  12.  
  13. \begin{document}
  14. \begin{figure}[!htb]
  15. \centering
  16. \begin{tikzpicture}[
  17. node distance=1.25cm,
  18. auto,
  19. >=latex'
  20. ]
  21. \node [intg] (kp) {Is database of concrete clear cover available from construction drawings?};
  22. \node [int] (ki1) [below of=kp,yshift=-1cm,xshift=-2.25cm] {Use Jeffreys Prior, Eq xx};
  23. \node [int] (ki2) [below of=kp,yshift=-1cm,xshift=2.25cm] {Use Conjugate Prior, Eq yy};
  24. \node [intg] (ki3) [below of=kp,yshift=-2.75cm] {Find Posterior Parameters for population of concrete cover};
  25. \node [intg] (ki4) [below of=kp,yshift=-4.5cm] {Plot the posterior density function to help practitioner pick value of cc};
  26.  
  27. \draw[->] (kp) |- node[pos=0.25] {} (ki1);
  28. \draw[->] (kp) |- node[pos=0.25] {} (ki2);
  29. \draw[->] (ki1) -- node[pos=0.25] {} (ki3);
  30. \draw[->] (ki2) -- node[pos=0.25] {} (ki3);
  31. \draw[->] (ki3) -- node[] {} (ki4);
  32. \end{tikzpicture}
  33. \caption{Data Fusion system using Bayesian approach for updating Compressive strength $f_c$ in case of data from Literature and core compressive strength data for granite}
  34. \label{fig:datafusionindirectdirectfc}
  35. \end{figure}
  36. \end{document}
Attachments
Screen Shot 2013-10-20 at 3.24.59 PM.png
Screen Shot 2013-10-20 at 3.24.59 PM.png (58.29 KiB) Viewed 4424 times
Last edited by localghost on Sun Oct 20, 2013 12:40 pm, edited 1 time in total.
Reason: Sample code reduced to a minimal example (see Board Rules).

Tags:

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Sun Oct 20, 2013 1:07 pm

You are probably searching for something like this. The example uses the libraries calc to calculate coordinates and positioning to position nodes individually. Please refer to the PGF/TikZ user guide for details. The output is attached.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{tikz}
  4. \usetikzlibrary{arrows,calc,positioning}
  5.  
  6. \tikzstyle{intt}=[draw,text centered,minimum size=6em,text width=5.25cm,text height=0.34cm]
  7. \tikzstyle{intl}=[draw,text centered,minimum size=2em,text width=2.75cm,text height=0.34cm]
  8. \tikzstyle{int}=[draw,minimum size=2.5em,text centered,text width=3.5cm]
  9. \tikzstyle{intg}=[draw,minimum size=3em,text centered,text width=6.cm]
  10. \tikzstyle{sum}=[draw,shape=circle,inner sep=2pt,text centered,node distance=3.5cm]
  11. \tikzstyle{summ}=[drawshape=circle,inner sep=4pt,text centered,node distance=3.cm]
  12.  
  13. \begin{document}
  14. \begin{figure}[!htb]
  15. \centering
  16. \begin{tikzpicture}[
  17. >=latex',
  18. auto
  19. ]
  20. \node [intg] (kp) {Is database of concrete clear cover available from construction drawings?};
  21. \node [int] (ki1) [node distance=1.5cm and -1cm,below left=of kp] {Use Jeffreys Prior, Eq xx};
  22. \node [int] (ki2) [node distance=1.5cm and -1cm,below right=of kp] {Use Conjugate Prior, Eq yy};
  23. \node [intg] (ki3) [node distance=5cm,below of=kp] {Find Posterior Parameters for population of concrete cover};
  24. \node [intg] (ki4) [node distance=2cm,below of=ki3] {Plot the posterior density function to help practitioner pick value of cc};
  25.  
  26. \draw[->] (kp) -- ($(kp.south)+(0,-0.75)$) -| (ki1) node[above,pos=0.25] {Yes} ;
  27. \draw[->] (kp) -- ($(kp.south)+(0,-0.75)$) -| (ki2) node[above,pos=0.25] {No};
  28. \draw[->] (ki1) |- (ki3);
  29. \draw[->] (ki2) |- (ki3);
  30. \draw[->] (ki3) -- (ki4);
  31. \end{tikzpicture}
  32. \caption{Data Fusion system using Bayesian approach for updating Compressive strength $f_c$ in case of data from Literature and core compressive strength data for granite}
  33. \label{fig:datafusionindirectdirectfc}
  34. \end{figure}
  35. \end{document}

Final adjustments are up to you.


Thorsten
Attachments
qtmp.png
qtmp.png (6.26 KiB) Viewed 4419 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 9 guests