8

I have been trying to define styles to make a good block flowchart in TikZ package, but I'm not very good at it, could you make one with a combination of blue, cyan and green? I need to describe the process of solving a pair of differential equations. I have this in the preamble:

\usepackage{tikz}
\usetikzlibrary{%
    decorations.pathreplacing,%
    decorations.pathmorphing,%
    arrows,
    shapes,
    shapes.geometric
    }
    \tikzstyle{load}   = [ultra thick,-latex]
    \tikzstyle{stress} = [-latex]
    \tikzstyle{dim}    = [latex-latex]
    \tikzstyle{axis}   = [-latex,black!55]
 \tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm,text centered, draw=black, fill=red!30]
 \tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
 \tikzstyle{process} = [rectangle, minimum width=4cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=orange!30]
 \tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text width=3cm, text centered, draw=black, fill=green!30]
 \tikzstyle{arrow} = [thick,->,>=stealth]

One of the flowcharts I do is this

\begin{center}
\begin{tikzpicture}[node distance=3cm]
\node (start) [startstop] {Dada una EDO de $1^{er}$ orden};
\node (dec1) [decision, below of=start,yshift=-1cm] {¿Es de la forma $\frac{dy}{dx}=f(x)\cdot g(y)$?};
\node (pro1a) [process, right of=dec1, xshift=2cm] {Emplee una sustitución $u$, tal que $\frac{du}{dx}=G(u)F(x)$ y siga el caso como si:};
\node (pro1b) [process, below of=dec1,yshift=-1cm] {Transforme en $\frac{dy}{g(y)}=f(x)dx$};
\node (pro2) [process, below of=pro1b] {Integre};
\node (end) [startstop, below of=pro2] {$H(y)=T(x)+C$, Solución general};
\draw [arrow] (start) -- (dec1);
\draw [arrow] (dec1) -- node[anchor=east] {sí} (pro1b);
\draw [arrow] (dec1) -- node[anchor=south] {no} (pro1a);
\draw [arrow] (pro1a) |- (pro1b);
\draw [arrow] (pro1b) -- (pro2);
\draw [arrow] (pro2) -- (end);
\end{tikzpicture}
\end{center}

and I get this: my flowchart

I've been watching and these styles have caught my attention style 1 style 2 style 3

1
  • 1
    Welcome to TeX.SX! Is it just the styles you need help with, are you able to setup the structure of the flowchart? If so, can you add a small compilable document (just the necessary packages and the tikzpicture) to your question? Aug 3, 2014 at 7:54

1 Answer 1

9

Here are some definitions of three different node set styles to get the aspect of the images you posted:

enter image description here

The code:

\documentclass[varwidth]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{%
    decorations.pathreplacing,%
    decorations.pathmorphing,%
    arrows,
    arrows.meta,
    positioning,
    shapes,
    shadows,
    shapes.geometric
    }

\definecolor{myblue1}{RGB}{0,157,209}
\definecolor{myblue2}{RGB}{161,224,255}
\definecolor{myblue3}{RGB}{216,229,245}
\definecolor{myblue4}{RGB}{0,149,229}

\tikzset{
  startend1/.style={
    rectangle, 
    rounded corners=15pt, 
    text width=2cm, 
    minimum height=1cm,
    align=center, 
    line width=2pt,
    draw=white,
    font=\color{white}\sffamily, 
    fill=myblue1,
    drop shadow
  },  
 data1/.style={
   trapezium, 
   trapezium left angle=70, 
   trapezium right angle=110, 
   text width=1.5cm, 
   inner ysep=17pt,
   align=center, 
   line width=2pt,
   draw=white,
   font=\color{black}\sffamily, 
   top color=myblue2,
   bottom color=myblue2!20,
   drop shadow
  },  
  process1/.style={
    rounded corners,
    text width=2.6cm, 
    minimum height=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    line width=2pt,
    draw=white, 
    top color=myblue1,
    bottom color=myblue1!30,
    drop shadow
  },  
  decision1/.style={
    diamond, 
    text width=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    line width=2pt,
    draw=white, 
    fill=myblue1,
    drop shadow
  },  
  arrow1/.style={
    {Square[]}->,
    myblue1,
    >=stealth
  },  
} 

\tikzset{
  startend2/.style={
    rectangle, 
    rounded corners=15pt, 
    text width=2cm, 
    minimum height=1cm,
    align=center, 
    line width=1pt,
   draw=myblue1!70!black, 
    font=\color{white}\sffamily, 
    fill=myblue1,
  },  
 data2/.style={
   trapezium, 
   trapezium left angle=70, 
   trapezium right angle=110, 
   text width=1.5cm, 
   inner ysep=17pt,
   align=center, 
   line width=1pt,
   draw=myblue1!70!black, 
   font=\color{black}\sffamily, 
   fill=myblue1,
  },  
  process2/.style={
    rounded corners,
    text width=2.6cm, 
    minimum height=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    draw=myblue1!70!black,
    line width=1pt, 
    fill=myblue1,
  },  
  decision2/.style={
    diamond, 
    text width=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    line width=1pt,
    draw=myblue1!70!black, 
    fill=myblue1,
  },  
  arrow2/.style={
     ->,
    myblue1,
    >=stealth
  },  
} 

\tikzset{
  startend3/.style={
    rectangle, 
    rounded corners=15pt, 
    text width=2cm, 
    minimum height=1cm,
    align=center, 
    line width=2pt,
    font=\color{myblue1}\sffamily, 
    fill=myblue3,
  },  
 data3/.style={
   trapezium, 
   trapezium left angle=70, 
   trapezium right angle=110, 
   text width=1.5cm, 
   inner ysep=17pt,
   align=center,
   draw=myblue1, 
   font=\color{myblue1}\sffamily, 
   fill=white
  },  
  process3/.style={
    text width=2.6cm, 
    minimum height=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    fill=myblue4,
  },  
  decision3/.style={
    diamond, 
    text width=1.5cm, 
    align=center, 
    font=\color{myblue1}\sffamily, 
    fill=myblue3,
  },  
  arrow3/.style={
    ->,
    myblue1,
    >=stealth
  },  
} 

\begin{document}

\begin{tikzpicture}[node distance=1.5cm and 2cm]
\node[startend1] 
  (start) 
  {start};
\node[decision1,right=of start] 
  (dec) 
  {dec1};
\node[process1,right=of dec] 
  (pro) 
  {process};
\node[data1,below=of dec] 
  (data) 
  {data};
\coordinate[below=of data] (aux);  
\node[startend1] 
  (end) 
  at (pro|-aux)
  {end};

\begin{scope}[arrow1]
\draw
  (start) --  (dec);
\draw
  (dec) --  node[fill=white] {yes} (pro);
\draw
  (dec) --  node[fill=white] {no} (data);
\draw
  (pro) |- (data);
\draw
  (data) |- (end);
\end{scope}  
\end{tikzpicture}

\begin{tikzpicture}[node distance=1.5cm and 2cm]
\node[startend2] 
  (start) 
  {start};
\node[decision2,right=of start] 
  (dec) 
  {dec2};
\node[process2,right=of dec] 
  (pro) 
  {process};
\node[data2,below=of dec] 
  (data) 
  {data};
\coordinate[below=of data] (aux);  
\node[startend2] 
  (end) 
  at (pro|-aux)
  {end};

\begin{scope}[arrow2]
\draw
  (start) --  (dec);
\draw
  (dec) --  node[fill=white] {yes} (pro);
\draw
  (dec) --  node[fill=white] {no} (data);
\draw
  (pro) |- (data);
\draw
  (data) |- (end);
\end{scope}  
\end{tikzpicture}

\begin{tikzpicture}[node distance=1.5cm and 2cm]
\node[startend3] 
  (start) 
  {start};
\node[decision3,right=of start] 
  (dec) 
  {dec3};
\node[process3,right=of dec] 
  (pro) 
  {process};
\node[data3,below=of dec] 
  (data) 
  {data};
\coordinate[below=of data] (aux);  
\node[startend3] 
  (end) 
  at (pro|-aux)
  {end};

\begin{scope}[arrow3]
\draw
  (start) --  (dec);
\draw
  (dec) --  node[fill=white] {yes} (pro);
\draw
  (dec) --  node[fill=white] {no} (data);
\draw
  (pro) |- (data);
\draw
  (data) |- (end);
\end{scope}  
\end{tikzpicture}

\end{document}

And here's your actual diagram adapted to the style 1:

\documentclass[varwidth,border=3pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{%
    decorations.pathreplacing,%
    decorations.pathmorphing,%
    arrows,
    arrows.meta,
    positioning,
    shapes,
    shadows,
    shapes.geometric
    }

\definecolor{myblue1}{RGB}{0,157,209}
\definecolor{myblue2}{RGB}{161,224,255}
\definecolor{myblue3}{RGB}{216,229,245}
\definecolor{myblue4}{RGB}{0,149,229}

\tikzset{
  startend1/.style={
    rectangle, 
    rounded corners=15pt, 
    text width=3cm, 
    minimum height=1cm,
    align=center, 
    line width=2pt,
    draw=white,
    font=\color{white}\sffamily, 
    fill=myblue1,
    drop shadow
  },  
 data1/.style={
   trapezium, 
   trapezium left angle=70, 
   trapezium right angle=110, 
   text width=1.5cm, 
   inner ysep=17pt,
   align=center, 
   line width=2pt,
   draw=white,
   font=\color{black}\sffamily, 
   top color=myblue2,
   bottom color=myblue2!20,
   drop shadow
  },  
  process1/.style={
    rounded corners,
    text width=4cm, 
    minimum height=1.5cm, 
    align=center, 
    font=\color{white}\sffamily, 
    line width=2pt,
    draw=white, 
    top color=myblue1,
    bottom color=myblue1!30,
    drop shadow
  },  
  decision1/.style={
    diamond, 
    text width=3cm, 
    align=center, 
    font=\color{white}\sffamily, 
    line width=2pt,
    draw=white, 
    fill=myblue1,
    drop shadow
  },  
  arrow1/.style={
    {Square[]}->,
    myblue1,
    >=stealth
  },  
} 

\begin{document}

\begin{tikzpicture}[node distance=1cm]
\node[startend1] 
  (start)  
  {Dada una EDO de $1^{er}$ orden};
\node[decision1,below=of start] 
  (dec1)  
  {¿Es de la forma $\frac{dy}{dx}=f(x)\cdot g(y)$?};
\node[process1, right=of dec1] 
  (pro1a)  
  {Emplee una sustitución $u$, tal que $\frac{du}{dx}=G(u)F(x)$ y siga el caso como si:};
\node[process1, below= of dec1] 
  (pro1b)  
  {Transforme en $\frac{dy}{g(y)}=f(x)dx$};
\node[process1, below=of pro1b] 
  (pro2)  
  {Integre};
\node[startend1, below=of pro2] 
  (end)  
  {$H(y)=T(x)+C$, Solución general};

\draw[arrow1] 
  (start) -- (dec1);
\draw[arrow1] 
  (dec1) -- node[anchor=east] {sí} (pro1b);
\draw[arrow1] 
  (dec1) -- node[anchor=south] {no} (pro1a);
\draw[arrow1] 
  (pro1a) |- (pro1b);
\draw[arrow1] 
  (pro1b) -- (pro2);
\draw[arrow1] 
  (pro2) -- (end);
\end{tikzpicture}

\end{document}

enter image description here

Remarks

  • The shadows library was used to add a drop shadow to the node shapes.

  • The arrows.meta library was used to produce the arrow tips using {Square[]}->.

  • Using the top color and bottom color keys the nodes were colorized using vertical shadings.

  • The old and inappropriate of= syntax was replaced with =of with the help of the positioning library.

  • The old \tikzstyle was replaced with the newer and more convenient \tikzset.

0

You must log in to answer this question.

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