使用 Tikz 绘制 2.4Ghz ISM 频段

使用 Tikz 绘制 2.4Ghz ISM 频段

我正在尝试在 Tikz 中制作下图。但是,由于我对 Tikz 还比较陌生,因此如果没有示例代码,我无法自己制作图像。我还没有看到其他人要求做类似的事情,所以我现在有点不知所措。

2.4 Ghz ISM band

有谁可以帮助我使用 Tikz 绘制这个 2.4 Ghz ISM 频段?

答案1

给你一个开始(并展示它真的很简单,甚至土拨鼠都可以做到这一点;-)。

\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[rotate=90,transform shape]
\xdef\lstN{37}
\foreach \X in {0,...,36}
{\xdef\lstN{\lstN,\X}
\ifnum\X=10
\xdef\lstN{\lstN,38}
\fi}
\xdef\lstN{\lstN,39}
\foreach \X [count=\Y,evaluate=\Y as \Z using {int(2400+2*\Y)}] in \lstN
{\draw[overlay] (0,-\Y/2) to[out=0,in=0,looseness=12] coordinate[midway](aux)
(0,{-(\Y+1)/2}) coordinate (aux1);
\foreach \XX in {37,38,39}
{\ifnum\X=\XX
\fill[blue!20] (0,-\Y/2) to[out=0,in=0,looseness=12] (0,{-(\Y+1)/2});
\fi}
\node at (0.5,{-(2*\Y+1)/4}){\X};
\node[anchor=east,font=\sffamily] at (-0.1,{-(2*\Y+1)/4}){\Z\,MHz};
\path(aux); 
  }
\draw (0,-1/2) -- (aux1);  
\end{tikzpicture}
\end{document}

enter image description here

答案2

结果并不像 marmot 的那么好,但我认为代码更简单。

\documentclass[tikz,border=2mm]{standalone} 
\usetikzlibrary{shapes.geometric}
\usepackage{siunitx}

\begin{document}
\begin{tikzpicture}

\begin{scope}
\clip (-1mm,0) rectangle (20cm,3);
\foreach \i in {1,...,40}
    \node[ellipse, shape border rotate=90, minimum width=5mm, 
    minimum height=5cm, draw, anchor=east] at (\i*5mm,0) (\i) {};
\end{scope}

\draw (1.west)--(40.east);

\foreach \i [count=\ni, evaluate=\i as \fq using int(2040+2*\i)] in {37,0,1,...,10,38,11,12,...,36,39}{
    \node at ([yshift=7mm]\ni.center) {\i};
    \node[rotate=90, anchor=east] at ([yshift=-2mm]\ni.center) {\fq\ MHz};
    }
\end{tikzpicture}
\end{document}

enter image description here

相关内容