如何让箭头显得更自然?

如何让箭头显得更自然?

我不知道如何将箭头放到自然的位置。源代码如下

\begin{tikzpicture}
\draw [decorate,decoration={coil,segment length=7.2mm,aspect=1,amplitude=2mm},->,>=stealth] (2,1.7)--(3,0.5);
\end{tikzpicture}

箭头的示例图像

答案1

以下是几种方法:

  • 降低比例
  • 减少线圈的长度
  • 使用柱长在箭头前留出一些空间(未显示)

解决方案

\documentclass[10pt, border=10pt]{standalone}

\usepackage{tikz}
\usetikzlibrary{arrows.meta, decorations.pathmorphing
}

\begin{document}


\begin{tikzpicture}
  % ~~~ the problem ~~~~~~~~~~~
  \draw [   decorate,
            decoration={coil,segment length=7.2mm,aspect=1,amplitude=2mm},
            -stealth]               (2, 1.7) -- ( 3, 0.5);

  % ~~~ for reference ~~~~~~~~
  \draw [-stealth]                  (2, 1.2) -- (3, 0);

  % ~~~ modified aspect ratio of spring ~~~~~~~~~~~
  \draw [   decorate,
            decoration={coil,segment length=7.2mm,aspect=.9,amplitude=2mm},
            -stealth]               (2, 0.7) -- ( 3, -.5);

  % ~~~ coil reduced in length ~~~~~~~~~~~
  \draw [   decorate,
            decoration={coil,segment length=7.0mm,aspect=1,amplitude=2mm},
            -stealth]               (2, 0.0) -- ( 3, -1.2);
            
    % ~~~ notes ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    \node at ( 4.5, 0.5)    {the problem};
    \node at ( 4.5, 0)      {for reference};
    \node at ( 4.5, -.5)    {lower aspect};
    \node at ( 4.5, -1.2)   {reduced length};

\end{tikzpicture}


\end{document}

相关内容