【发布时间】:2016-01-03 22:23:51
【问题描述】:
为了开始使用 matplotlib 动画,我看到了 double_pendulum 的精彩示例。 这是代码的一部分:
fig = plt.figure()
ax=fig.add_subplot(111,aspect='equal',autoscale_on=True)
ax.grid()
line, = ax.plot([], [], 'b-', lw=2)
time_text = ax.text(0.02, 0.95, '', transform=ax.transAxes)
energy_text = ax.text(0.02, 0.90, '', transform=ax.transAxes)
我想问他为什么在实现 ax.plot 时使用逗号。 当我使用类似的代码时,我还需要使用 line,作为 init 函数的返回语句,即使它是唯一返回的对象。我试着看了一下,找不到答案。有人可以帮我搞定吗?
谢谢
【问题讨论】:
标签: python animation matplotlib