Line in a flow chart in Xelatex tikz

Asked

Viewed 3,573 times

5

Below is the code and the result of the flowchart I’m building:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes,backgrounds}

\begin{document}

\begin{figure}[!ht]

\centering

% Define block styles
\tikzstyle{block} = [rectangle, draw, fill=white, 
    text width=6em, text centered, rounded corners, node distance=2cm, minimum height=2em]
\tikzstyle{line} = [draw, -latex]
\tikzstyle{cloud} = [draw, ellipse,fill=white, node distance=2cm,
    minimum height=2em]

\begin{tikzpicture}[node distance = 3cm, auto]
    % Place nodes
    \node [block]                         (observacoes) {Fazer Observações};
    \node [block, below of = observacoes] (perguntas) {Formular Perguntas Interessantes};
    \node [block, below of = perguntas]   (hipoteses) {Levantar Hipóteses};
    \node [block, below of = hipoteses]   (predicoes) {Realizar Predições};
    \node [block, below of = predicoes]   (testar)  {Testar Predições};
    \node [block, below of = testar]      (coletar) {Coletar Dados Para Predições};
    \node [block, right of = testar, xshift=2cm, yshift=-1cm]      (refinar) {Refinar as Hipóteses};
    \node [block, below of = coletar]     (teorias) {Desenvolver Teorias};
    % Draw edges
    \path [line] (observacoes) -- (perguntas);
    \path [line] (perguntas)   -- (hipoteses);
    \path [line] (hipoteses)   -- (predicoes);
    \path [line] (predicoes)   -- (testar);
    \path [line] (testar)      -- (coletar);
    \path [line] (coletar)     -- (teorias);
    \path [line] (coletar)     -- (refinar);
    \path [line] (refinar)     -- (testar);
\end{tikzpicture}

\caption{\label{metodoestatisto.fluxograma} Fluxograma mostrando os passos do Método Científico.}

\end{figure}

\end{document}

fluxograma

I would like to create a line that leaves the "Develop Theories" node for the "Make Observations" node, similar to the line I drew in red in the figure below:

fluxograma final

How to proceed to do this?

1 answer

3


Before the end of the figure, add one more path:

\path [line,rounded corners=7ex] 
          (teorias.west) -- ++(-1.5cm,0) |- (observacoes.west);

(remove the rounded corners=7ex for connections with straight lines)

  • 1

    Perfect. I did not want rounded Corners, but adapted the code to the design I desired. Thank you.

  • 1

    @Marcusnunes, your red pen was hardly sharp... :-)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.