Skip to content
Advertisement

2 Interactive Poly Editor with matplotlib Not Working

Following a tutorial Poly Editor I’ve created 2 polygons, added to the figure, and then instantiated 2 interactive polygons. I expected that when I adjusted the individual polygon it would work separately. However they were conflicting with each other.

Then I have tried some changes in the original code yet still not produce a successful result. If you’re familiar I would like to have your help. I really appreciate in advance.

Here is my following adjusted code:

JavaScript

Advertisement

Answer

I think that the problem is that you don’t restore the animated artists when restoring backgronds. See tutorial on blitting here. I could get it working adding some modifications to restore all the animated object added to the figure, since also the contour lines are animated you should declare them in the main and not in the class then restore all animated inside the class. Here’s my code and result:

JavaScript

2poly-interactive

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement