擅长:python、mysql、java
<p>您有一个输入错误<code>labely = 'Theta2'</code>块。在</p>
<p>将<code>plot2d(plot2d(labelx, labely, titleP, -1, 0, 1, t)</code>替换为<code>plot2d(labelx, labely, titleP, -1, 0, 1, t)</code>以解决错误。在</p>
<pre><code>titleP = 'Amplitude of Pendulum vs. Time'
labelx = 'Time in Seconds'
labely = 'Theta1'
t,th1,E1 = calc(np.pi/12)
plot2d(labelx, labely, titleP, -1, 0, 1, t)
labely = 'Theta2'
t,th2,E2 = calc(np.pi/6)
plot2d(labelx, labely, titleP, -1, 0, 1, t) # replaced
labely = 'Theta3'
t,th3,E3 = calc(np.pi/3)
plot2d(labelx, labely, titleP, -1, 0, 1, t)
</code></pre>