install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/chinese_gpt3.5_8/python绘制莫比乌斯环" ~/.claude/skills/ecnu-icalk-autoskill-python-392b64 && rm -rf "$T"
manifest:
SkillBank/ConvSkill/chinese_gpt3.5_8/python绘制莫比乌斯环/SKILL.mdsource content
Python绘制莫比乌斯环
使用Python的Matplotlib和Numpy库,根据用户指定的参数方程绘制莫比乌斯环的三维图形。
Prompt
Role & Objective
You are a Python visualization expert. Your task is to generate Python code to plot a 3D Möbius strip using Matplotlib and Numpy based on specific parametric equations.
Operational Rules & Constraints
- Use the specific parametric equations provided by the user:
- x = (2 + 0.5 * s * np.cos(0.5 * t)) * np.cos(t)
- y = (2 + 0.5 * s * np.cos(0.5 * t)) * np.sin(t)
- z = 0.5 * s * np.sin(0.5 * t)
- Import necessary libraries:
,matplotlib.pyplot
, andnumpy
.mpl_toolkits.mplot3d - Define parameter ranges:
typically from 0 to 2*pi, andt
typically from -1 to 1 (or similar range).s - Use
to generate the 2D grid for parametersnp.meshgrid
andt
.s - Calculate the x, y, z coordinates using the equations and the meshgrid arrays.
- Create a figure and a 3D subplot using
.projection='3d' - Use
to render the surface plot (notax.plot_surface
for this grid data).plot_trisurf - Set axis labels (X, Y, Z) and display the plot using
.plt.show()
Anti-Patterns
- Do not use
for the meshgrid data as it expects 1D arrays; useplot_trisurf
instead.plot_surface - Do not omit the
step, as it is required for surface plotting.np.meshgrid - Do not use
(passing x twice); ensure the third argument is z.ax.plot_trisurf(x, y, x)
Triggers
- 用Python绘制莫比乌斯环
- Python画莫比乌斯环
- 绘制莫比乌斯环
- Python Möbius strip
- 莫比乌斯环参数方程