19

I want to draw several large arrows filled with gradients at different locations. How would you do that ?

I am new to tikz and latex and came to the following (ugly) solution:

   \def\y{0.4}
   \def\x{0.2}
    \newcommand\verticalarrow[2]{
        (0,0) -- (#1,0) -- (#1,#2-\y) -- (#1+\x,#2-\y) -- (#1/2,#2) -- 
        (-\x,#2-\y) -- (0,#2-\y) -- (0,0)
    }

    \draw[bottom color=white, top color=gray, very thin] \verticalarrow{0.15}{4};

It's complex and for now I don't know how to locate my arrows ...

Corentin
  • 9,981
Manuel Selva
  • 1,839

1 Answers1

27

I would use a \node with the single arrow shape, which is provided by the shapes.arrows library. The shape can be adjusted quite flexibly:

\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{shapes.arrows, fadings}
\begin{document}
\begin{tikzpicture}[every node/.append style={draw=gray, left color=white, single arrow}]
\node [
    right color=orange,
    single arrow,
    minimum height=1cm
] {};

\node at (0,-1) [
    right color=blue!50!cyan,
    single arrow,
    minimum height=1cm,
    shading angle=90+60,
    rotate=60
] {};

\node at (1,0) [
    right color=red!80!black,
    single arrow,
    single arrow head extend=0.4cm,
    single arrow tip angle=110,
    single arrow head indent=0.1cm,
    minimum height=2cm,
    inner sep=1pt,
    shading angle=90+90,
    rotate=90
] {};


\end{tikzpicture}
\end{document}
Jake
  • 232,450
  • 1
    Many thanks. One more note on your code, I am not able to reduce the width of the arrows, is there any minimum width that can't be passed for nodes ? – Manuel Selva Aug 30 '12 at 13:13
  • 2
    @ManuelSelva: There's a minimum width that's determined by the inner sep, which by default is 2pt. In the red arrow, I've set inner sep=1pt, which makes the tail of the arrow thinner. You can reduce this even further. To reduce the size of the arrow head, change the single arrow head extend value. – Jake Aug 30 '12 at 13:16
  • 1
    I am really tired, I didn't checked your screenshot again and missed the thinner red arrow at the first look. Thanks. – Manuel Selva Aug 30 '12 at 13:17
  • 1
    @ManuelSelva: No problem =). Glad it helps – Jake Aug 30 '12 at 13:19