origin画三维曲面图加边框
时间: 2023-06-17 10:05:30 浏览: 608
您可以使用Matplotlib的mplot3d工具箱来绘制三维曲面图,并使用ax.box来添加边框。下面是一个简单的例子:
```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# 创建数据
x = np.arange(-5, 5, 0.25)
y = np.arange(-5, 5, 0.25)
x, y = np.meshgrid(x, y)
r = np.sqrt(x ** 2 + y ** 2)
z = np.sin(r)
# 创建3D图形对象
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# 绘制曲面图
ax.plot_surface(x, y, z, cmap='coolwarm')
# 添加边框
ax.box(on=True)
# 显示图形
plt.show()
```
这将绘制一个带有边框的三维曲面图。您可以根据需要调整曲面和边框的颜色和样式。
阅读全文
相关推荐















