|

楼主 |
发表于 2022-10-20 14:57:45
|
显示全部楼层
# 3d plot paraboloid
# p302.py
# cxd 2022-10-16
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
fig = plt.figure(figsize=(8,6))
ax = plt.axes(projection='3d')
a = np.linspace(0, np.pi*2, 40)
r = np.linspace(0, 1, 40)
R, A = np.meshgrid(r, a)
x = R*np.cos(A)
y = R*np.sin(A)
z = R**2
ax.plot_surface(x, y, z, cmap=plt.cm.Blues)
plt.show()
#end
|
|