对在各种能级和维度中创建盒状图中的粒子感兴趣。有人有源代码可以这样做吗?或者有好的软件包推荐吗?
答案1
我会给你一个最小工作示例(MWE),因为 TeX 人员可能会认为这是一个物理问题:)。
\documentclass{article}
\usepackage{tikz}
\usepackage{siunitx}
\usepackage{geometry}
\geometry{margin=0.75in}
\usepackage{nopageno}
%The 0.25 is simply a scale factor to make the levels fit.
%\n is the level quantum number, \x is a variable whose range is
%determined by the domain statement. The box width of this example is 2.
\begin{document}
\begin{tikzpicture}[domain=0:2]
\draw(0,5)--(0,0)--(2,0)--(2,5);
\foreach \n in {1,2,3,4}{
\draw(0,{0.25*\n*\n})--(2,{0.25*\n*\n});
\draw plot ({\x},{0.25*\n*\n+sin(\n*\x/2*180)}) ;}
\end{tikzpicture}
\end{document}