如何更改tikz中的箭头提示

Tsf*_*Tsf 17 tikz

是否有一种简单的方法可以使用以下方法增加箭头尖端的大小:

\tikzset{myptr/.style=->, ????}
Run Code Online (Sandbox Code Playgroud)

没有从头开始设计新的箭头样式?

Mat*_*gro 24

一个解决方案,非常快,只需缩放箭头%2,如下所示:

\documentclass[multi=false,tikz,border=2mm]{standalone}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}

\begin{tikzpicture}
%1
\draw [->,>=stealth] (0,.5) -- (2,.5);
%2
\draw [decoration={markings,mark=at position 1 with
    {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}] (0,0) -- (2,0);
\end{tikzpicture}

\end{document}
Run Code Online (Sandbox Code Playgroud)

这会产生:

在此输入图像描述

(抱歉过度放大).

这个问题的答案中以及在这个答案中,我使用的是更多的来源.

附录

\tikzset做法.这段代码:

\documentclass[multi=false,tikz,border=2mm]{standalone}
\usetikzlibrary{arrows,decorations.markings}

\begin{document}

\begin{tikzpicture}
\tikzset{myptr/.style={decoration={markings,mark=at position 1 with %
    {\arrow[scale=3,>=stealth]{>}}},postaction={decorate}}}
%1
\draw [->,>=stealth] (0,.5) -- (2,.5);
%2
\draw [myptr] (0,0) -- (2,0);
\end{tikzpicture}

\end{document}
Run Code Online (Sandbox Code Playgroud)

产生与上述相同的输出(来源:PGF手册,第2.8节).

显然你可以用-Latex而不是stealth.

  • 我原来的定义是\ tikzset {myptr/.style = -latex}.我想以一种简单的方式改变它,因为它在很多地方使用.我试图将它改为类似\ tikzset {myptr/.style = { - Latex [length = 3mm,width = 5mm]}}但它产生了一个错误:"我不知道关键'长度[..." .顺便说一句,我对tikz的了解相当差. (2认同)