import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from mpl_toolkits.mplot3d import Axes3D
def data(i, z, line):
z = np.sin(x+y+i)
ax.clear()
line = ax.plot_surface(x, y, z,color= 'b')
return line,
n = 2.*np.pi
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = np.linspace(0,n,100)
y = np.linspace(0,n,100)
x,y = np.meshgrid(x,y)
z = np.sin(x+y)
line = ax.plot_surface(x, y, z,color= 'b')
ani = animation.FuncAnimation(fig, data, fargs=(z, line), interval=30, blit=False)
plt.show()
-
Notifications
You must be signed in to change notification settings - Fork 0
turtle89/3d-surface-plot-animation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
3D Surface Plot Animation using Matplotlib in Python
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published