Skip to content

Commit 243db8a

Browse files
Add files via upload
1 parent f079fb6 commit 243db8a

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
from mpl_toolkits.mplot3d import Axes3D
4+
5+
# Create a meshgrid for the surface plot
6+
x = np.linspace(-5, 5, 100)
7+
y = np.linspace(-5, 5, 100)
8+
X, Y = np.meshgrid(x, y)
9+
Z = np.sin(np.sqrt(X**2 + Y**2))
10+
11+
# Create a 3D surface plot
12+
fig = plt.figure()
13+
ax = fig.add_subplot(111, projection='3d')
14+
ax.plot_surface(X, Y, Z, cmap='viridis')
15+
16+
# Add labels
17+
ax.set_xlabel('X-axis')
18+
ax.set_ylabel('Y-axis')
19+
ax.set_zlabel('Z-axis')
20+
21+
# Show the plot
22+
plt.show()

0 commit comments

Comments
 (0)