如何在 tikz 中绘制粗箭头(如下图所示)?

如何在 tikz 中绘制粗箭头(如下图所示)?

我想要画这样的东西:

在此处输入图片描述

我无法画出这个。这是我画的:

在此处输入图片描述

这是代码:

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning,arrows}
\usepackage[utf8x]{inputenc}
\usepackage{scalefnt}

\begin{document}


\begin{tikzpicture}[fill=blue,ultra thick, scale = 0.75, transform shape,font=\Large]


\node[rectangle] (a1) [draw, minimum width=1.5cm,minimum height=1cm] {};
\coordinate[right=0.75cm of a1] (a4)  {};
\node[rectangle] (a2) [draw, minimum width=1.5cm,minimum height=1cm,right of=a1,node distance=3cm] {};
\node[rectangle] (a3) [draw, minimum width=1.5cm,minimum height=1cm,below of=a4,node distance=3cm] {};

\node[rectangle] (a5) [draw, minimum width=1.5cm,minimum height=1cm,right of=a3,node distance=4cm] {};
\node[rectangle] (a6) [draw, minimum width=1.5cm,minimum height=1cm,above of=a5,node distance=1.25cm] {};

\node[rectangle] (a7) [draw, minimum width=1.5cm,minimum height=1cm,below right of=a5,node distance=3cm] {};



\end{tikzpicture}

\end{document}

这种箭头该如何画?

答案1

这是一个基于postaction并受到启发的解决方案是否可以更改 TikZ/PGF 中箭头的大小?飞羊答案):

\documentclass[a4paper,10pt]{article}
%\documentclass[a4paper,10pt]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{positioning,arrows}
\usepackage[utf8x]{inputenc}
\usepackage{scalefnt}

\begin{document}


\begin{tikzpicture}[fill=blue,ultra thick, scale = 0.75, transform shape,font=\Large]
\tikzstyle{myarrows}=[line width=1mm,draw=blue,-triangle 45,postaction={draw, line width=3mm, shorten >=4mm, -}]

\node[rectangle] (a1) [draw, minimum width=1.5cm,minimum height=1cm] {};
\coordinate[right=0.75cm of a1] (c1)  {};
\node[rectangle] (a2) [draw, minimum width=1.5cm,minimum height=1cm,right of=a1,node distance=3cm] {};
\node[rectangle] (a3) [draw, minimum width=1.5cm,minimum height=1cm,below of=c1,node distance=3cm] {};
\node[rectangle] (a5) [draw, minimum width=1.5cm,minimum height=1cm,right of=a3,node distance=4cm] {};
\node[rectangle] (a6) [draw, minimum width=1.5cm,minimum height=1cm,above of=a5,node distance=1.25cm] {};
\node[rectangle] (a7) [draw, minimum width=1.5cm,minimum height=1cm,below right of=a5,node distance=3cm] {};
\coordinate[right=0.2cm of a2]  (c2)  {};
\coordinate[left=0cm of a6]     (c3)  {};
\coordinate[below=1.5cm of a5]  (c4)  {};

\draw [draw=blue,line width=3mm]   (a1)--(a2);

\draw [myarrows](c1)--(a3);
\draw [myarrows](c2)--(c3);
\draw [myarrows](a3)--(a5);
\draw [myarrows](a5)--(c4)--(a7);
\end{tikzpicture}
\end{document}

在此处输入图片描述

我所做的是定义箭头样式,其中箭头绘制两次:第一次使用,line width箭头大小与原始图像中的大小相同;第二次使用,line width箭头为勾号,没有箭头。这是通过样式定义postaction中可以看到的选项实现的myarrows

您可能需要调整矩形的外观,以使它们看起来像原始图像。

忘了说,如果您想改变箭头的粗细,您只需改变两个line width值,\tikzstile{myarrows}直到找到适合您需要的值。

相关内容