我想在我的 tikz 文档中绘制这样的箭头 -
我已经使用以下代码完成了它 -
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[node distance=2.5cm,auto,>=latex]
\usepgflibrary{shapes.arrows}
\node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.5cm,anchor=west,rotate=90] at (-3.25,-1) {};
\node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.6cm,anchor=west] at (-3.12,-0.845) {};
\node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.5cm,anchor=west,rotate=90] at (4.25,-1) {};
\node [single arrow, draw=none,fill=black,opacity=0.5, minimum width=0.8cm, minimum height=1.60cm,anchor=west,rotate=180] at (4.12,-0.845) {};
\end{tikzpicture}
\end{document}
但是,我发现两个箭头之间有间隙,尤其是当我使用 时scalebox
。我不希望箭头之间有间隙,而是想让它感觉像一个箭头。有人能告诉我怎么做吗?
谢谢 !
答案1
你可以使用arrow box
这样的形状:
\documentclass[tikz, border=0.125cm]{standalone}
\usetikzlibrary{shapes.arrows}
\begin{document}
\begin{tikzpicture}
\node [arrow box,
arrow box shaft width=0.125cm,
inner sep=0.125cm/2, % should be half shaft width
fill=gray,
arrow box arrows={north:.5cm, west:0.5cm}]
{};
\node [arrow box,
arrow box shaft width=0.125cm,
inner sep=0.125cm/2, % should be half shaft width
fill=gray,
arrow box arrows={north:.5cm, east:0.5cm}]
at (1,0) {};
\end{tikzpicture}
\end{document}
答案2
您可以手动放置两个路径(不是很优雅,但可以工作,需要 tikz 的 cvs 版本):
\documentclass[article]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\def\lwidth{3mm}
\begin{tikzpicture}[garrow/.style={black!50!white, line width=\lwidth},
garrowtip/.style={-{Triangle[length=5mm,width=8mm]}},]
\draw[garrow] (.5*\lwidth,0) edge[garrowtip] (.5*\lwidth,2);
\draw[garrow] (0,.5*\lwidth) edge[garrowtip] (2,.5*\lwidth);
\end{tikzpicture}
\end{document}
结果: