在曲线上画箭头

在曲线上画箭头

我想在红色曲线上添加箭头,如图所示在此处输入图片描述,这是我的代码

   \documentclass{article}
\usepackage[margin=0cm,nohead]{geometry}
\usepackage[active,tightpage]{preview}
\usepackage{pgfplots} % loads also tikz
\pgfplotsset{compat=newest}
\PreviewEnvironment{tikzpicture}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usetikzlibrary{shapes,arrows,arrows.meta,angles,quotes,patterns,patterns.meta}
  \usetikzlibrary{decorations.markings,decorations.pathmorphing}
    \tikzstyle{every node}=[font=\scriptsize]
\begin{document}
\begin{tikzpicture}
    \draw[->](-3,0)--(3,0) node[below]{$q$};
    \draw[->](0,-3)--(0,3) node[left]{$p$};
    
\draw [red,thick] plot[domain=0:12,variable=\t,smooth,samples=500]
    ({-\t r}: {2.0*exp(-0.1*\t)});
    
    
    \draw [blue,thick] (0,0) circle [radius=2];

\end{tikzpicture}
\end{document}

答案1

像这样?

\documentclass{article}
\usepackage[margin=0cm,nohead]{geometry}
\usepackage[active,tightpage]{preview}
\usepackage{pgfplots} % loads also tikz
\pgfplotsset{compat=newest}
\PreviewEnvironment{tikzpicture}
\usetikzlibrary{calc}
\usetikzlibrary{intersections}
\usetikzlibrary{shapes,arrows,arrows.meta,angles,quotes,patterns,patterns.meta}
  \usetikzlibrary{decorations.markings,decorations.pathmorphing}
 
\begin{document}
\begin{tikzpicture}
    
    \tikzset{every node}=[font=\scriptsize]
    \draw[->](-3,0)--(3,0) node[below]{$q$};
    \draw[->](0,-3)--(0,3) node[left]{$p$};
    
 \tikzset{%
  my arrow/.style={
    postaction={decorate,decoration={
    markings,
    mark=between positions 0.25 and 0.75 step 0.25 with {\color{blue}\arrow{latex}}}
    }}
}    
\draw [red,thick,my arrow] plot[domain=0:12,variable=\t,smooth,samples=60,postaction={decorate}]
    ({-\t r}: {2.0*exp(-0.1*\t)});
   
    \draw [blue,thick] (0,0) circle [radius=2];

\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容