使用 Tikz 向复杂轮廓添加箭头

使用 Tikz 向复杂轮廓添加箭头

我正在尝试使用 Tikz 绘制一个复杂的轮廓,用于几天后要交的论文。以下是我想要的两张粗略图:在此处输入图片描述

为此,我改编了此代码线。

\documentclass[border=10pt,tikz,multi]{standalone}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}
  [
    decoration={%
      markings,
      mark=at position 0.5 with {\arrow[line width=1pt]{>}},
    }
  ]
  \draw [help lines,->] (-4,0) -- (4,0) coordinate (xaxis);
  \draw [help lines,->] (0,-1) -- (0,4) coordinate (yaxis);
  \node at (1,0) {$\times$};
  \node at (-1,0) {$\times$};
  \path [draw, line width=0.8pt] (1.5,0) node [below, font=\scriptsize] {$1+\epsilon$} -- (3,0) node [below] {$R$} arc (0:180:3) node [below] {$-R$} -- (-1.5,0) node [below, font=\scriptsize] {$1-\epsilon$} arc (180:0:.5);
  \path [draw, line width=0.8pt] (-0.5,0) -- (0.5, 0) node [below, font=\scriptsize] {$1-\epsilon$} arc (180:0:.5);
  \path [draw, line width=0.8pt, postaction=decorate] (1.5,0) node [below, font=\scriptsize] {$1+\epsilon$} -- (3,0) node [below] {$R$} arc (0:180:3) node [below] {$-R$} -- (-1.5,0) ; arc (180:0:.5);
  \node [below] at (xaxis) {$Re(z)$};
  \node [left] at (yaxis) {$Im(z)$};
  \node [below left] {$O$};
  \node at (-1,.8) {$\gamma_{1}$};
  \node at (1,.8) {$\gamma_{2}$};

  \node at (2,3) {$\Gamma_{1}$};
\end{tikzpicture}

该代码的结果是在此处输入图片描述

我将非常感激您的帮助:

  1. 删除 1-\varepsilon 和 1+\varepsilon。我一直在研究代码,但我不知道要删除哪些部分,因为删除术语时会出现错误!

  2. 像我的绘图一样在轮廓上添加箭头。当我尝试添加箭头时,它会在轮廓的一个区域添加多个箭头。

  3. 在极点下方添加 -1 和 1。
  4. 复制下半平面的轮廓得到图 2。

另外,是否可以使小写 gamma 的下标看起来更像下标?非常感谢。

答案1

第一个图

\documentclass[border=10pt,tikz,multi]{standalone}
\usetikzlibrary{decorations.markings}

\begin{document}
\begin{tikzpicture}
  [line width=.8pt,
    decoration={%
      markings,
      mark=at position 0.25 with {\arrow[line width=1pt]{>}},
      mark=at position 0.5 with {\arrow[line width=1pt]{>}},    
      mark=at position 0.75 with {\arrow[line width=1pt]{>}}    
    }
  ]
  \draw [help lines,->] (-4,0) -- (4,0) coordinate (xaxis);
  \draw [help lines,->] (0,-1)coordinate(-yaxis) -- (0,4) coordinate (yaxis);
  \node  at (1.5,0) {$\times$};
  \node  at (-1.5,0) {$\times$};
  \draw [postaction=decorate] (3,0) arc (0:180:3) ;
  \draw [postaction=decorate] (-3,0) --(-2,0) arc  (180:0:.5) --(1,0) arc  (180:0:.5)--(3,0) ;
  \node [below] at (xaxis) {$Re(z)$};
  \node [above] at (yaxis) {$Im(z)$};
  \node [below left] {$O$};
  \node at (-1.5,.8) {$\gamma_{1}$};
  \node at (1.5,.8) {$\gamma_{2}$};
  \node at (2,3) {$\Gamma_{1}$};
  \node at (3,-.5){$R$};
  \node at (-3,-.5){$-R$};
  \node at (1.5,-.5){$1$};
  \node at (-1.5,-.5){$-1$};
\end{tikzpicture}
\end{document}

对于第二幅图,只需添加yscale=-1tikzpicture环境中并替换\node [above] at (yaxis) {$Im(z)$};\node [above] at (-yaxis) {$Im(z)$};

\documentclass[border=10pt,tikz,multi]{standalone}
\usetikzlibrary{decorations.markings}

\begin{document}
\begin{tikzpicture}
  [yscale=-1,line width=.8pt,
    decoration={%
      markings,
      mark=at position 0.25 with {\arrow[line width=1pt]{>}},
      mark=at position 0.5 with {\arrow[line width=1pt]{>}},    
      mark=at position 0.75 with {\arrow[line width=1pt]{>}}    
    }
  ]
  \draw [help lines,->] (-4,0) -- (4,0) coordinate (xaxis);
  \draw [help lines,->] (0,-1)coordinate(-yaxis) -- (0,4) coordinate (yaxis);
  \node  at (1.5,0) {$\times$};
  \node  at (-1.5,0) {$\times$};
  \draw [postaction=decorate] (3,0) arc (0:180:3) ;
  \draw [postaction=decorate] (-3,0) --(-2,0) arc  (180:0:.5) --(1,0) arc  (180:0:.5)--(3,0) ;
  \node [below] at (xaxis) {$Re(z)$};
  \node [above] at (-yaxis) {$Im(z)$};
  \node [below left] {$O$};
  \node at (-1.5,.8) {$\gamma_{1}$};
  \node at (1.5,.8) {$\gamma_{2}$};
  \node at (2,3) {$\Gamma_{2}$};
  \node at (3,-.5){$R$};
  \node at (-3,-.5){$-R$};
  \node at (1.5,-.5){$1$};
  \node at (-1.5,-.5){$-1$};
\end{tikzpicture}
\end{document} 

答案2

在此处输入图片描述

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\renewcommand\Re{\mathrm{Re}}
\renewcommand\Im{\mathrm{Im}}
\tikzset
  {decoration=
     {markings,
      mark=at position 0.5 with {\arrow{stealth}}
     },
   plain/.style={line width=0.8pt},
   arrow/.style={plain,postaction=decorate}
  }
\begin{document}
\begin{tikzpicture}
  \draw [help lines,->] (-4,0) -- (4,0) node[below] {$\Re(z)$};
  \draw [help lines,->] (0,-1) -- (0,4) node[left] {$\Im(z)$};
  \path ( 1,0) node {$\times$} node[below]{$1$};
  \path (-1,0) node {$\times$} node[below]{$-1$};
  \draw [arrow] (3,0) coordinate (h) arc (0:60:3) coordinate (a);
  \draw [arrow] (a) arc(60:120:3) coordinate (b);
  \draw [arrow] (b) arc(120:180:3) node [below] {$-R$} coordinate (c);
  \draw [plain] (c) -- (-1.5,0) coordinate(d);
  \draw [arrow] (d) arc (180:0:.5) coordinate (e);
  \draw [arrow] (e) -- (0.5, 0) coordinate (f);
  \draw [arrow] (f) arc (180:0:.5) coordinate (g);
  \draw [plain] (g) -- (h) node [below] {$R$};
  \node [below left] {$O$};
  \node at (-1,.8) {$\gamma_1$};
  \node at (1,.8) {$\gamma_2$};
  \node at (2,3) {$\Gamma_1$};
\end{tikzpicture}
\begin{tikzpicture}
  \draw [help lines,->] (-4,0) -- (4,0) node[below] {$\Re(z)$};
  \draw [help lines,->] (0,-4) -- (0,1) node[left] {$\Im(z)$};
  \path ( 1,0) node {$\times$} node[above]{$1$};
  \path (-1,0) node {$\times$} node[above]{$-1$};
  \draw [arrow] (3,0) coordinate (h) arc (0:-60:3) coordinate (a);
  \draw [arrow] (a) arc(-60:-120:3) coordinate (b);
  \draw [arrow] (b) arc(-120:-180:3) node [above] {$-R$} coordinate (c);
  \draw [plain] (c) -- (-1.5,0) coordinate(d);
  \draw [arrow] (d) arc (-180:0:.5) coordinate (e);
  \draw [arrow] (e) -- (0.5, 0) coordinate (f);
  \draw [arrow] (f) arc (-180:0:.5) coordinate (g);
  \draw [plain] (g) -- (h) node [above] {$R$};
  \node [above right] {$O$};
  \node at (-1,-.8) {$\gamma_3$};
  \node at (1,-.8) {$\gamma_4$};
  \node at (2,-3) {$\Gamma_2$};
\end{tikzpicture}
\end{document}

相关内容