1

How can i make arrows like this?

arrow diagram

This is what I've done so far.

\documentclass[10pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[left=22mm,bottom=22mm,right=28mm,top=30mm]{geometry}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\pagestyle{empty}

% Define block styles
\tikzstyle{decision} = [diamond, draw, fill=blue!20, 
    text width=4.5em, text badly centered, node distance=3cm, inner sep=0pt]
\tikzstyle{block} = [rectangle, draw, fill=blue!20, 
    text width=2cm, text centered, rounded corners, minimum height=10mm]
\tikzstyle{line} = [draw, -latex']
\tikzstyle{cloud} = [draw, ellipse,fill=red!20, node distance=3cm,
    minimum height=2em]
\begin{center}
\begin{tikzpicture}[node distance = 3.4cm, auto]

 \node  [block,yshift=30mm] (1) {1};
      \node [block, xshift=-30mm] (2) {2};
      \node[block, xshift=-60mm] (3) {3};
\node [block, xshift=-90mm] (4) {4};
        \node [block, xshift=-120mm] (5) {5};

       \node [block,yshift=30mm, xshift=-45mm] (6) {6};
         \node [block,yshift=-40mm, xshift=-105mm] (7) {7};
     \node [block,yshift=-60mm, xshift=-105mm] (8) {8};
             \node [block,yshift=-25mm, xshift=-75mm] (9) {9};
\node[block, xshift=-60mm,yshift=-60mm] (10) {10};
\node [block, xshift=-30mm,yshift=-60mm] (11) {11};
\node[block, xshift=0mm,yshift=-60mm] (12) {12};

\draw[->,>=latex'] (4) -- (3);
\draw[->,>=latex'] (3) -- (2);

\end{tikzpicture}
\end{center}
\end{document}

my attempt

9
  • 1
    One trick is to use \draw (9) -| (7); Another is to locate a corner using \coordinate (97) at (9 -| 7); May 17, 2017 at 23:51
  • 2
    Why did you delete everything in both your question and my answer?
    – cfr
    May 22, 2017 at 22:06
  • 1
    That's ridiculous. Why ever not? You may be able to delete it. I'm not sure. But it will still be there. Deleted posts are still on the site. Why did you post on a public website if you didn't want it here? This is how the site works: your question stays for other users.
    – cfr
    May 22, 2017 at 22:10
  • 1
    I've flagged this for the mods to rollback.
    – cfr
    May 22, 2017 at 22:11
  • 1
    What do you mean? I said it is public - nothing about its being popular. What difference does that make?
    – cfr
    May 22, 2017 at 22:11

1 Answer 1

10

A bit of a miscellany ...

\documentclass[border=10pt,x11names,svgnames,dvipsnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,shadows.blur}% arrows is deprecated ; shapes would be better loaded with the required suffixes
\begin{document}
\tikzset{% \tikzstyle is deprecated
  block/.style={draw, top color=white!90!#1, bottom color=#1, shading angle=45, text width=2cm, text centered, rounded corners, minimum height=10mm},
}
\begin{tikzpicture} [node distance = 3.4cm, >=Latex, thick, draw=darkgray, every node/.append style={blur shadow}]
  \node [block=Crimson, text=white, yshift=30mm] (1) {1};
  \node [block=gray!40, xshift=-30mm] (2) {2};
  \node [block=green!25, xshift=-60mm] (3) {3};
  \node [block=magenta!25, xshift=-90mm] (4) {4};
  \node [block=yellow!30, xshift=-120mm] (5) {5};

  \node [block=DodgerBlue3, text=white, yshift=30mm, xshift=-45mm] (6) {6};
  \node [block=yellow!30, yshift=-40mm, xshift=-105mm] (7) {7};
  \node [block=magenta!25, yshift=-60mm, xshift=-105mm] (8) {8};
  \node [block=DodgerBlue3, text=white, yshift=-25mm, xshift=-75mm] (9) {9};
  \node [block=green!25, xshift=-60mm,yshift=-60mm] (10) {10};
  \node [block=Purple3!75!Periwinkle, text=white, xshift=-30mm,yshift=-60mm] (11) {11};
  \node [block=green!25, xshift=0mm,yshift=-60mm] (12) {12};

  \begin{scope}[every node/.append style={circle, draw=darkgray, anchor=center, fill=white, inner sep=1pt}, draw=darkgray, every edge/.append style={->, draw}]
    \path
    (5) edge coordinate [pos=.4] (a) (4)
    (4) edge coordinate [pos=.4] (b) (3)
    (3) edge coordinate [pos=.4] (c) (2)
    (a) edge (7)
    (12) edge (11)
    (11) edge (10)
    (10) edge coordinate [pos=.2] (d)  (8)
    (8) edge (7)
    (d) edge (9.south -| d)
    (b) edge (9.north -| b)
    (c) edge (6.south -| c)
    (2) -- (2 -| 1) coordinate [pos=.2] (e) node [pos=1, anchor=center] (f) {+}
    ;
    \path [every edge/.append style={<-}]
    (f) edge (1) edge (2);
    \path (12) edge (f);
    \draw [->] (e) |- (6);
    \draw [->] (e) |- (9);
    \foreach \i in {a,...,e} \node at (\i) {};
  \end{scope}
\end{tikzpicture}
\end{document}

connecting dots and shading blocks

0

You must log in to answer this question.

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