Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在做一些带有ion()功能的动画情节。我想绘制和删除一些线条。我发现了axvspan()函数,我可以根据需要绘制线条和形状。但只要我在做动画,我也想删除那些线条和形状。我找不到删除它们的方法。
ion()
axvspan()
好的,我找到了必要的功能。我使用dir()函数来查找方法。axvspan()返回一个matplotlib.patches.Polygon结果。这种类型的数据有set_visible方法,在x.set_visible(0)我删除线条和形状时使用它。
dir()
matplotlib.patches.Polygon
set_visible
x.set_visible(0)