免费资源网 - https://freexyz.cn/
图形:
0、import
import numpy as np
import matplotlib as mpl
from matplotlib import cm
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
1、水平和垂直平面
# 创建画布
fig = plt.figure(figsize=(12, 8),
facecolor='lightyellow'
)
# 创建 3D 坐标系
ax = fig.gca(fc='whitesmoke',
projection='3d'
)# 二元函数定义域平面
x = np.linspace(0, 9, 9)
y = np.linspace(0, 9, 9)
X, Y = np.meshgrid(x, y)
# -------------------------------- 绘制 3D 图形 --------------------------------
# 平面 z=4.5 的部分
ax.plot_surface(X,
Y,