Quantcast

Flow chart

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Flow chart

Andrej Kastrin-4
Dear pgf users!

This is my first post to this mailing list. (Sorry for the first mail without the subject in header).

I need to draw simple flow chart which contains three nodes (figure below):

#########
#   A   #
#########
    x
    x        #########
    xxxxxxxx #   C   #
    x        #########
    x
#########
#   B   #
#########

My question is how to connect node C to the center of the edge (line) A-B. I paste minimal example code below.

Thanks in advance for any suggestions.

-- Andrej


\documentclass{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%

\begin{document}
\pagestyle{empty}

% Define block styles
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
    text width=30mm, text ragged, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{every node}=[font=\footnotesize]

\begin{tikzpicture}[node distance = 2cm, auto]
    % Place nodes
    \node [block] (A) {A};
    \node [block, below of=first] (B) {B};
    \node [cloud, right of=first] (C) {C};
\end{tikzpicture}

\end{document}



     

------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pgf-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Flow chart

Matthew Leingang-3
How is this?

\begin{tikzpicture}[node distance = 4cm, auto]
    % Place nodes
   \node [block] (first) {A};
   \node [block, below of=first] (B) {B};
   \draw (first) -- (B) node[coordinate,midway] (m) {};
   \node [block, right of=m] (C) {C};
   \draw (m) -- (C);
\end{tikzpicture}

Note the placing of a coordinate node on the line between A and B.  Coordinate nodes are a nice way to name
coordinates without putting anything there.

Best,
Matthew


On May 7, 2010, at 2:38 PM, Andrej Kastrin wrote:

> Dear pgf users!
>
> This is my first post to this mailing list. (Sorry for the first mail without the subject in header).
>
> I need to draw simple flow chart which contains three nodes (figure below):
>
> #########
> #   A   #
> #########
>    x
>    x        #########
>    xxxxxxxx #   C   #
>    x        #########
>    x
> #########
> #   B   #
> #########
>
> My question is how to connect node C to the center of the edge (line) A-B. I paste minimal example code below.
>
> Thanks in advance for any suggestions.
>
> -- Andrej
>
>
> \documentclass{article}
> \usepackage[latin1]{inputenc}
> \usepackage{tikz}
> \usetikzlibrary{shapes,arrows}
> \usepackage{verbatim}
> \usepackage[active,tightpage]{preview}
> \PreviewEnvironment{tikzpicture}
> \setlength\PreviewBorder{5pt}%
>
> \begin{document}
> \pagestyle{empty}
>
> % Define block styles
> \tikzstyle{block} = [rectangle, draw, fill=blue!20,
>    text width=30mm, text ragged, rounded corners, minimum height=4em]
> \tikzstyle{line} = [draw, -latex']
> \tikzstyle{every node}=[font=\footnotesize]
>
> \begin{tikzpicture}[node distance = 2cm, auto]
>    % Place nodes
>    \node [block] (A) {A};
>    \node [block, below of=first] (B) {B};
>    \node [cloud, right of=first] (C) {C};
> \end{tikzpicture}
>
> \end{document}
>
>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> pgf-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/pgf-users

--
Matthew Leingang
Clinical Associate Professor of Mathematics
[hidden email]




------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pgf-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Flow chart

JL Diaz
Another solution (there are always a lot of ways of doing  a draw in tikz):

\usetikzlibrary{shapes,arrows,positioning}
% Define block styles
\tikzstyle{block} = [rectangle, draw, fill=blue!20,
   text width=30mm, text ragged, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{every node}=[font=\footnotesize]

\begin{tikzpicture}[on grid]
   % Place nodes
   \node [block] (first) {A};
   \node [block, below=3cm of first] (B) {B};
   \node [cloud, draw, below right=15mm and 3cm of first] (C) {C};
\draw (first)--(B) (C) -| (B);
\end{tikzpicture}


Saludos,
--JL Diaz


------------------------------------------------------------------------------


_______________________________________________
pgf-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pgf-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Flow chart

Andrej Kastrin-4
In reply to this post by Matthew Leingang-3
Matthew, thanks for your fast replay. Works like a charm.

Best, Andrej

--- On Fri, 5/7/10, Matthew Leingang <[hidden email]> wrote:

> From: Matthew Leingang <[hidden email]>
> Subject: Re: [Pgf-users] Flow chart
> To: "Andrej Kastrin" <[hidden email]>
> Cc: [hidden email]
> Date: Friday, May 7, 2010, 8:43 PM
> How is this?
>
> \begin{tikzpicture}[node distance = 4cm, auto]
>     % Place nodes
>    \node [block] (first) {A};
>    \node [block, below of=first] (B) {B};
>    \draw (first) -- (B)
> node[coordinate,midway] (m) {};
>    \node [block, right of=m] (C) {C};
>    \draw (m) -- (C);
> \end{tikzpicture}
>
> Note the placing of a coordinate node on the line between A
> and B.  Coordinate nodes are a nice way to name
> coordinates without putting anything there.
>
> Best,
> Matthew
>
>
> On May 7, 2010, at 2:38 PM, Andrej Kastrin wrote:
>
> > Dear pgf users!
> >
> > This is my first post to this mailing list. (Sorry for
> the first mail without the subject in header).
> >
> > I need to draw simple flow chart which contains three
> nodes (figure below):
> >
> > #########
> > #   A   #
> > #########
> >    x
> >    x        #########
> >    xxxxxxxx
> #   C   #
> >    x        #########
> >    x
> > #########
> > #   B   #
> > #########
> >
> > My question is how to connect node C to the center of
> the edge (line) A-B. I paste minimal example code below.
> >
> > Thanks in advance for any suggestions.
> >
> > -- Andrej
> >
> >
> > \documentclass{article}
> > \usepackage[latin1]{inputenc}
> > \usepackage{tikz}
> > \usetikzlibrary{shapes,arrows}
> > \usepackage{verbatim}
> > \usepackage[active,tightpage]{preview}
> > \PreviewEnvironment{tikzpicture}
> > \setlength\PreviewBorder{5pt}%
> >
> > \begin{document}
> > \pagestyle{empty}
> >
> > % Define block styles
> > \tikzstyle{block} = [rectangle, draw, fill=blue!20,
> >    text width=30mm, text ragged, rounded
> corners, minimum height=4em]
> > \tikzstyle{line} = [draw, -latex']
> > \tikzstyle{every node}=[font=\footnotesize]
> >
> > \begin{tikzpicture}[node distance = 2cm, auto]
> >    % Place nodes
> >    \node [block] (A) {A};
> >    \node [block, below of=first] (B) {B};
> >    \node [cloud, right of=first] (C) {C};
> > \end{tikzpicture}
> >
> > \end{document}
> >
> >
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> > _______________________________________________
> > pgf-users mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/pgf-users
>
> --
> Matthew Leingang
> Clinical Associate Professor of Mathematics
> [hidden email]
>
>
>
>


     


------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/pgf-users
Loading...