jupyter绘制三维图正方形立体
时间: 2023-12-09 13:36:53 浏览: 174
以下是使用jupyter绘制三维图正方形立体的示例:
```python
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = [0, 1, 1, 0, 0, 1, 1, ]
y = [0, 0 1, 1, 0, 0, 1, 1]
z =0, 0, 0, 0, 1, 1, 1, 1]
ax.plot_trisurf(x, y, z, linewidth=0.2, antialiased=True)
plt.show()
```
这段代码将会绘制一个正方形的立体图形,其中x、y、z分别表示正方形的8个顶点的坐标。使用plot_trisurf函数可以将这些点连接起来,形成一个立体图形。
阅读全文
相关推荐












