答案1
编辑:我之前帖子的完整版本,提供完整且更结构化的示例,用于\foreach
创建自动半圆等。
现在您只需要在循环中选择半径\foreach
,一切就都好了。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\begin{document}
\begin{tikzpicture}[scale=2,font=\footnotesize]
\tikzset{xmid/.style={inner sep=0pt,below}}
\tikzset{midarrow/.style={decoration={markings, mark=at position 0.45 with {\arrow{stealth}}},
postaction={decorate}}}
\draw (-5,0) -- (5,0);
\draw (0,0) node[xmid] {\strut $O$} -- (0,5);
\foreach \x in {1,2,3,4}
{
\draw (\x,0.05) --++ (0,-0.1)
(-\x,0.05) --++ (0,-0.1);
}
\foreach \r [count=\i] in {0.55,0.15,0.35,0.2}
{
\coordinate (a\i) at (\i-\r,0);
\coordinate (aa\i) at (-\i+\r,0);
\draw (a\i) node[xmid] {\strut $a_{\i}$} arc (180:0:\r) node[midway] (mm\i) {}node[xmid] {\strut $b_{\i}$};
\draw (aa\i) node[xmid] {\strut $-a_{\i}$} arc (0:180:\r) node[midway] (m\i) {} node[xmid] {\strut $-b_{\i}$};
}
\foreach \i in {1,...,4}
{
\draw[midarrow] (m\i) arc (180:0:\i) node[pos=0.45,above] {$S^{'}_{\i}$};
}
\foreach \j [count=\i] in {5,6,7,8}
{
\node [above right] at (m\i) {$D_{\i}$};
\node [above right] at (mm\i) {$D_{\j}$};
}
\end{tikzpicture}
\end{document}
答案2
您可以尝试使用国际环境政策研究所,对于那些想在不使用 Tikz 的情况下绘制类似东西的人来说,这是一个很棒的工具。
答案3
将所有半圆制成一个循环。已包含比例因子。使用更高的比例因子值,可以增加沿 x 轴的点名称使用的字体大小,或防止旋转。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\rArray{0.5, 0.18, 0.42, 0.3} %% semi-circles radius
\def\mScale{1.4} %% To adjust the sizes
\draw[-latex] (-5*\mScale,0) -- (5*\mScale,0) node[below] {$\sigma$};
\draw[-latex] (0,0) -- (0,5*\mScale) node[right] {$j \omega$};
\node at (0,-0.5) {$0$};
\foreach \i [count=\c] in \rArray{
\draw[thick] (\mScale*\c-\mScale*\i,0) node[rotate=90, left] {\footnotesize $a_{\c}$} arc (180:0:\i*\mScale) node[rotate=90, left] {\footnotesize $b_{\c}$};
\draw[thick] (-\mScale*\c+\mScale*\i,0) node[rotate=90, left] {\footnotesize $-a_{\c}$} arc (0:180:\i*\mScale) node[rotate=90, left] {\footnotesize $-b_{\c}$};
\draw[thick] (-\c*\mScale, \i*\mScale) arc (180:0:\c*\mScale);
\node at (\c*\mScale-0.9*\mScale*\i, \mScale*\i+0.2) {\footnotesize $D_\c$};
\node at (-\c*\mScale+0.9*\mScale*\i, \mScale*\i+0.2) {\footnotesize $D_\c$};
\draw (0,0) ++(0,\i*\mScale) ++(100:\c*\mScale) node [above] {$S_{\c}'$};
\draw[thick,-latex] (0,0) ++(0,\i*\mScale) ++(100:\c*\mScale) arc (100:99:\c*\mScale);
\draw (\c*\mScale, -0.07) --+(0,0.14);
\draw (-\c*\mScale, -0.07) --+(0,0.14);
}
\end{tikzpicture}
答案4
该解决方案允许将半圆的中心放置在任意但对称的位置。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\rArray{{0.4, 0.18, 0.42, 0.2}} %% semi-circles radius
\def\cArray{{0.6,2,3,3.8}} %% semi-circles centers
\def\mScale{2} %% To adjust the sizes
\pgfmathsetmacro\ax{\mScale*\rArray[3] +\mScale*\cArray[3] +0.5}
\draw[-latex] (-\ax,0) -- (\ax,0) node[below] {$\sigma$};
\draw[-latex] (0,0) -- (0,\ax) node[right] {$j \omega$};
\node at (0,-0.5) {$0$};
\foreach \x in {0,...,3}{
\pgfmathsetmacro\rs{\mScale*\rArray[\x]}
\pgfmathsetmacro\cs{\mScale*\cArray[\x]}
\draw[thick] (\cs-\rs, 0) node[below] {\footnotesize $a_{\x}$} arc (180:0:\rs) node[below] {\footnotesize $b_{\x}$};
\draw[thick] (-\cs+\rs, 0) node[below] {\footnotesize $-a_{\x}$} arc (0:180:\rs) node[below] {\footnotesize $-b_{\x}$};
\draw[thick] (-\cs, \rs) arc (180:0:\cs);
\node at (\cs-0.75*\rs, \rs+0.2) {\footnotesize $D_\x$};
\node at (-\cs+0.75*\rs, \rs+0.2) {\footnotesize $D_\x$};
\draw (0,0) ++(0,\rs) ++(110:\cs) node [above] {$S_{\x}'$};
\draw[thick,-latex] (0,0) ++(0,\rs) ++(110:\cs) arc (110:109:\cs);
\draw (\cs, -0.07) --+(0,0.14);
\draw (-\cs, -0.07) --+(0,0.14);
}
\end{tikzpicture}
\end{document}