Dear LC members,
I have a flow chart which consists of a parallelogram, a rectangle, a diamond and a trapezoid as attached. I tried myself but could not get any successful results and I couldn't combine with No line Query and Operations box. I would really appreciate your help on giving me a flow chart sample.
Thank you very much.
bkarpuz
Graphics, Figures & Tables ⇒ Tikz | Simple flow chart
Tikz | Simple flow chart
- Attachments
-
- FlowChart.JPG (11.26 KiB) Viewed 11264 times
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Tikz | Simple flow chart
Hello,
Stefan
what did you try? Perhaps we can continue that instead that reader start from scratch.bkarpuz wrote:I tried myself but could not get any successful results
It should be no problem. Once we see your code I guess we are able to show how to do the connection.bkarpuz wrote:I couldn't combine with No line Query and Operations box.
Stefan
LaTeX.org admin
Tikz | Simple flow chart
Thank you Stefan_K.Stefan_K wrote:Hello,
what did you try? Perhaps we can continue that instead that reader start from scratch.bkarpuz wrote:I tried myself but could not get any successful results
It should be no problem. Once we see your code I guess we are able to show how to do the connection.bkarpuz wrote:I couldn't combine with No line Query and Operations box.
Stefan
Here is my code.
Code: Select all
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,shapes.multipart}
\begin{document}
\tikzset{
startend/.style = {draw, circle},
input/.style = {draw, trapezium, trapezium left angle=70, trapezium right angle=-70, minimum height=4em},
print/.style = {draw, trapezium, trapezium left angle=-70, trapezium right angle=-70, minimum height=4em},
operation/.style = {rectangle, draw, text width=17em, text centered, minimum height=4em},
question/.style = {diamond, draw, text width=8em, text centered, inner sep=0pt},
line/.style = {draw, -latex'}
}
\begin{tikzpicture}[node distance = 3cm, auto]
\node [startend] (start) {Start};
\node [input, below of=start] (input) {$h,n_{0},x_{0},y_{0}$};
\node [operation, below of=input] (operationa) {$n=0$};
\node [operation, below of=operationa] (operationb) {$n=n+1$\\ $x_{n}=x_{n-1}+h$\\ $y_{n}=y_{n-1}+hf(x_{n-1},y_{n-1})$};
\node [question, below of=operationb] (question) {$x_{n}\geq{}x_{0}+n_{0}h$};
\node [print, below of=question] (print) {$x_{0},y_{0}$};
\node [startend, below of=print] (end) {End};
\path [line] (start) -- (input);
\path [line] (input) -- (operationa);
\path [line] (operationa) -- (operationb);
\path [line] (operationb) -- (question);
\path [line] (question) -- node {No} (operationb);
\path [line] (question) -- node {Yes} (print);
\path [line] (print) -- (end);
\end{tikzpicture}
\end{document}
Thank you.
bkarpuz
- Stefan Kottwitz
- Site Admin
- Posts: 10290
- Joined: Mon Mar 10, 2008 9:44 pm
Tikz | Simple flow chart
I guess the spacing is between the anchors / centers of the nodes, and they have a different height. You could specify an
The missing path can be done like
which means going 4 to the left and connecting to
Stefan
yshift
value, or use relative positioning such as below =4cm of nodename
.The missing path can be done like
Code: Select all
\path [line] (question) -- ++(-4,0) |- (operationb);
operationb
horizontally and then vertically.Stefan
LaTeX.org admin
Tikz | Simple flow chart
Thank you Stefan_K, I have modified it as follows for my purposeStefan_K wrote: The missing path can be done likewhich means going 4 to the left and connecting toCode: Select all
\path [line] (question) -- ++(-4,0) |- (operationb);
operationb
horizontally and then vertically.
Code: Select all
\path [line] (question) -- node {No} ++(-4,0) |- (operationb);
Also it is possible to edit the lines so that I adjust manually the distance between each object?
Thanks once more.
bkarpuz
Last edited by bkarpuz on Fri Dec 21, 2012 7:51 am, edited 1 time in total.
Tikz | Simple flow chart
The following line does not compile.Stefan_K wrote:You could specify anyshift
value, or use relative positioning such asbelow =4cm of nodename
.
Code: Select all
\node [input] (input) {$h,n_{0},t_{0},y_{0}$};
\node [operation, below=2cm of input] (operationa) {$n=0$};
Thank you.
bkarpuz