答案1
钛钾Z 有plot
该操作。
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[trig format=rad]
\draw (0,-1) rectangle (3*pi,1);
\draw[dashed] foreach \X in {1,...,5}
{(\X*\X*pi/12,-1) -- (\X*\X*pi/12,1)};
\draw[red,thick] plot[variable=\t,domain=0:36*pi*pi,samples=101,smooth]
({\t/(12*pi)},{cos(sqrt(\t))});
\path (0,-1) node[left] {$-1$} -- (0,1) node[left]{$1$}
node[midway,left]{$0$} (-0.7,0) node[left] (cQL) {$\cos(q\,L)$}
(4,-1.5) node(E){$E$};
\draw[-stealth] (cQL.north) -- ++ (0,0.5);
\draw[-stealth] (E.east) -- ++ (0.5,0);
\end{tikzpicture}
\end{document}
然而,在这里使用 pgfplots 可以说更“自然”。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xlabel={$E$},ylabel={$\cos(q\,L)$},trig format plots=rad,
xtick=\empty]
\addplot[red,thick,domain=0:36*pi*pi,samples=101,smooth] {cos(sqrt(x))};
\end{axis}
\end{tikzpicture}
\end{document}