我想在不同位置绘制几个填充渐变的大箭头。该怎么做?
我是 tikz 和 latex 的新手,并得出以下(丑陋的)解决方案:
\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};
这很复杂,现在我不知道如何定位我的箭头......
答案1
我将使用库提供的形状\node
。形状可以非常灵活地调整:single arrow
shapes.arrows
\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}