如何在线和圆弧中绘制方向箭头?

如何在线和圆弧中绘制方向箭头?

我想要绘制以下图片。到目前为止,我的代码如下:

\begin{tikzpicture}[xscale=1.5,yscale=1.5]
\draw [->] (0,-2) --(0,2) node [left] {${\rm Im}(p)$};
\draw [->] (-2,0) --  (2,0) node [below] {${\rm Re}(p)$};
\draw [thick] (1,-1.8) --(1,1.8);
\draw [fill] (0,-1.8) --(1,-1.8); \draw [fill] (0,1.8) --(1,1.8);
\draw [black] (0,1.8) arc [radius=1.8, start angle=90, end angle = 270];
\draw [fill] (0.5,1) circle [radius=.05];
\draw [fill] (0.5,0.5) circle [radius=.05];
\draw [fill] (0.5,-0.5) circle [radius=.05];
\draw [fill] (0.5,-1) circle [radius=.05];
\node at (1.15,-0.15) [] {$\sigma$};
\draw [fill] [<-] (0.65,1.1)--(1.5,1.5);
\end{tikzpicture}

如果有人能帮我画方向箭头我将不胜感激,是否可以在图表中包含文字?

预先感谢您的帮助。

在此处输入图片描述

答案1

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{tikzpicture}[scale=0.5,
decoration = {markings,
    mark=at position 0.10 with {\arrow {latex}},
    mark=at position 0.35 with {\arrow {latex}},
    mark=at position 0.70 with {\arrow {latex}},
    mark=at position 0.90 with {\arrow {latex}}
              }
                    ]
% axes
\draw [->] (0,-3.3) -- (0,4) node [left]  {${\rm Im}(p)$};
\draw [->] (-3.3,0) -- (4,0) node [below] {${\rm Re}(p)$};
% poles
    \foreach \i in {-2,-1, 1, 2}{\node at (1,\i) {$\times$};}
% curve
\draw[postaction={decorate},thick]
        (2,0) node[below right] {$\sigma$}
              |- (0,3) arc (90:270:3) -| (2,0);
\draw[<-,shorten <=2mm] (1,2)-- ++ (30:1.5) node[right] {poles};
\end{tikzpicture}
\end{document}

给出

在此处输入图片描述

曲线上的箭头sdecorations.markings-plane 由TikZ 库决定。

相关内容