Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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 ...

share|improve this question
add comment

1 Answer

up vote 11 down vote accepted

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}
share|improve this answer
    
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
    
@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
    
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
    
@ManuelSelva: No problem =). Glad it helps –  Jake Aug 30 '12 at 13:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.