Skip to content Skip to sidebar Skip to footer

Python: Grid Line Drawn Over Plot_surface() In Animation

I have been trying to animate a surface. So far all the animation works, and the surface is plotted nicely. Yet I have some straight lines on my surface that look like they are fro

Solution 1:

This is a bug (see here: https://github.com/matplotlib/matplotlib/issues/750/). The workaround is to clear the axes manually by removing all the objects.

You'll need to import the class that contains the surface so you can refer to it: from mpl_toolkits.mplot3d.art3d import Poly3DCollection

Then, replace ax.clear() with

artists = ax.findobj(match = Poly3DCollection)
for obj in artists:
    obj.remove()

Post a Comment for "Python: Grid Line Drawn Over Plot_surface() In Animation"