【发布时间】:2019-04-17 01:09:14
【问题描述】:
我可以制作六个圆的动画,也可以制作一条线的动画。当我尝试为两者设置动画时,我无法弄清楚 init() 和 animate() 应该返回什么。对于六个圆圈,我“返回元组(引脚)”,对于线,我“返回线”。每个引脚都是“类'matplotlib.patches.Circle'”,行是“类'matplotlib.lines.Line2D'。”
当我尝试为圆和线设置动画时,我尝试了许多不同的返回语句,但均未成功。以下是部分结果:
return line, tuple(pins) GIVES 'tuple' object has no attribute 'set_animated'
return tuple(pins) + (line) GIVES 只能将元组(不是“Line2D”)连接到元组
return tuple(pins) + tuple(line) GIVES 'Line2D' object is not iterable
【问题讨论】:
-
你说
pin是什么,但不是pins是什么。
标签: animation matplotlib