如何在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箭頭大小與原始圖像中的大小相同的箭頭;第二次使用 a line width,使箭頭打勾且沒有箭頭。這是透過postaction您可以在myarrows樣式定義中看到的選項來實現的。

您可能想要調整矩形外觀,使它們看起來像原始影像的外觀。

忘了說,如果您想更改箭頭的粗細,您只需更改其中的兩個line width值,\tikzstile{myarrows}直到找到適合您需求的值。

相關內容