如何在 TIKZ 上绘制这条曲线?

如何在 TIKZ 上绘制这条曲线?

我需要这张更高质量的图片用于论文,但我对 Tikz 的熟练程度不如我想要的那样。

我完成了部分圆、点和箭头的构造,但正如我想象的那样,我无法完成细节,比如圆在某个节点上被部分擦除。或者带有箭头的奇怪曲线 T_T。

我正在使用的文档类是文章类的变体。

这是我目前所做的:

\documentclass{article}
%Packages for the TIKZ%
\usepackage{xcolor}
\definecolor{azul}{RGB}{187,233,255}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\tikzset{
    %Define standard arrow tip
    >=stealth',
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}

\begin{document}

\begin{tikzpicture}
\draw[thick,->] (0,0) -- (5,0) node[anchor=north west] {x};
\draw[thick,->] (0,0) -- (0,5) node[anchor=south east] {y};
\filldraw[azul, draw=black, thick] (2.5,2.5) circle (2cm);
\filldraw[white, draw=black, thick] (2.5,2.5) circle (0.75cm);
\filldraw[black] (2.5,2.5) circle (3pt) node [anchor= south] {$\delta$};
\filldraw[black] (2.11,2.05) circle (3pt);
\draw[thick,->] (2.5,2.5) -- (3.03,3.03);
\draw[thick] (2.5,2.5) -- (1.8,3.07) node [anchor= south east] {$\epsilon$};
\draw[thick,->] (1.3,3.50) -- (0.93,3.78);
\end{tikzpicture}

\end{document}

我得到了这个: 在此处输入图片描述

我尝试重新创建的图像是这样的:

在此处输入图片描述

答案1

作为起点并使用这个很好的答案亨利·孟克并且仅适用于左图。必须根据所需的曲线形状手动设置坐标。

\documentclass[margin=3mm]{standalone}
%Packages for the TIKZ%
\usepackage{xcolor}
\definecolor{azul}{RGB}{187,233,255}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning} 
\usetikzlibrary{decorations.markings}
\tikzset{
    %Define standard arrow tip
    >=stealth',
    % Define arrow style
    pil/.style={
           ->,
           thick,
           shorten <=2pt,
           shorten >=2pt,}
}
\tikzset{
    set arrow inside/.code={\pgfqkeys{/tikz/arrow inside}{#1}},
    set arrow inside={end/.initial=>, opt/.initial=},
    /pgf/decoration/Mark/.style={
        mark/.expanded=at position #1 with
        {
            \noexpand\arrow[\pgfkeysvalueof{/tikz/arrow inside/opt}]{\pgfkeysvalueof{/tikz/arrow inside/end}}
        }
    },
    arrow inside/.style 2 args={
        set arrow inside={#1},
        postaction={
            decorate,decoration={
                markings,Mark/.list={#2}
            }
        }
    },
}
\begin{document}

\begin{tikzpicture}
\coordinate (A) at (2.11,2.05);
\coordinate (B) at (2.5,2.5);

\draw[thick,->] (0,0) -- (5,0) node[anchor=north west] {x};
\draw[thick,->] (0,0) -- (0,5) node[anchor=south east] {y};
\filldraw[azul, draw=black, thick] (2.5,2.5) circle (2cm);
\filldraw[white, draw=black, thick] (2.5,2.5) circle (0.75cm);

\draw[thick,->] (2.5,2.5) -- (3.03,3.03);
\draw[thick] (2.5,2.5) -- (1.8,3.07) node [anchor= south east] {$\epsilon$};
\draw[thick,->] (1.3,3.50) -- (0.93,3.78);

 \draw[blue,  thick] plot [smooth,tension=1]
        coordinates {(A) (2.3,2.1) (2.65,1.6) (3.5,1.8) (4,2.5)  (B)}
        [arrow inside={end=stealth,opt={blue,scale=2}}{0.3,0.5,0.75,0.97}];
   
\filldraw[black] (B) circle (3pt) node [anchor= south] {$\delta$};
\filldraw[black] (A) circle (3pt);
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

在此处输入图片描述

这两条曲线看起来是不同的;我把第一条画成了爱好曲线,第二条曲线椭圆。标记也不同;因此我在序言中定义了两种类型的装饰(具有不同类型的参数)。

第二条曲线的子弹是通过反复试验构建的。也许,如果您稍后需要绘图并需要对其进行稍微修改,最好通过沿椭圆的参数定义子弹。

\documentclass[11pt, margin=1cm]{standalone}

\usepackage{tikz}
\definecolor{azul}{RGB}{187, 233, 255}

\usetikzlibrary{arrows}
\usetikzlibrary{calc, math, hobby, decorations.markings}

\tikzset{
  >=stealth',  % define standard arrow tip
  pil/.style={  % define arrow style
    ->,
    thick,
    shorten <=2pt,
    shorten >=2pt
  },
  show two/.style={%  define markings along path
    decorate, decoration={markings,
      mark=between positions .1 and .99 step .5 with {
        {\arrow[blue, line width=.8pt]{#1}};
      }
    }
  },
  show three/.style={%  define markings along path
    decorate, decoration={markings,
      mark=between positions .3 and .99 step #1 with {
        {\arrow[blue, line width=.8pt]{>}};
      }
    }
  }
}

\begin{document}

\tikzmath{
  real \R, \r;
  \R = 2;
  \r = .75;
}
\begin{tikzpicture}[every node/.style={color=black, scale=.7}]
  \draw[very thin, ->] (0,0) -- (5,0) node[anchor=north west] {$x$};
  \draw[very thin, ->] (0,0) -- (0,5) node[anchor=south east] {$y$};

  \path (2.5, 2.5) coordinate (B);
  \path
  ($(B)+(240:.7*\r)$) coordinate (A1)
  ($(B)+(270:.65*\r)$) coordinate (A2)
  ($(B)+(269:1.3*\r)$) coordinate (A3)
  ($(B)+(-70:1.8*\r)$) coordinate (A4)
  ($(B)+(-25:2.2*\r)$) coordinate (A5)
  ($(B)+(15:2.*\r)$) coordinate (A6)
  ($(B)+(-10:.9*\r)$) coordinate (A7)
  ($(B)+(-30:.8*\r)$) coordinate (A8);
  
  \draw[fill=azul, even odd rule] (B) circle (\R) (B) circle (\r);
  \draw[->, gray] (B) -- node[pos=.6, fill=azul] {$\epsilon$} +(135: \R);
  \draw[->, gray] (B) -- node[anchor=west, inner sep=1pt] {$\delta$} +(85: \r);

  \draw[blue, thick, postaction={show three={.28}}]
  (A1) to[curve through={(A2) (A3) (A4) (A5) (A6) (A7) (A8)}] (B);
  \filldraw (B) circle (1.5pt) (A1) circle (1.5pt)
  node[anchor=north east, inner sep=1pt] {$(\phi(0),\psi(0))$}; 
\end{tikzpicture}

\begin{tikzpicture}[every node/.style={color=black, scale=.7}]
  \draw[very thin, ->] (0,0) -- (5,0) node[anchor=north west] {$x$};
  \draw[very thin, ->] (0,0) -- (0,5) node[anchor=south east] {$y$};

  \path (2.5, 2.5) coordinate (B);
  \path ($(B)+(155:.76*\r)$) coordinate (A1);
  
  \draw[fill=azul, even odd rule] (B) circle (\R) (B) circle (\r);
  \draw[->, gray] (B) -- node[pos=.6, fill=azul] {$\epsilon$} +(130: \R);
  \draw[->, gray] (B)
  -- node[pos=.4, anchor=south east, inner sep=1pt] {$\delta$} +(55: \r);

  \draw[blue, thick, postaction={show two={<}}, rotate=35]
  (B) ellipse[x radius={\R-.01}, y radius=.5];
  \filldraw (B) circle (1.5pt) (A1) circle (1.5pt)
  node[anchor=south east, inner sep=1pt] {$(\phi(0),\psi(0))$};
\end{tikzpicture}

\end{document}

相关内容