在python中使用matplotlib库绘制多元函数,具体方法如下:
import numpy as np #导入numpy库为np
import matplotlib.pyplot as plt #导入matplotlib库
np.random.seed(2)
x, y = np.random.randn(2, 30)
y *= 100
z = 11*x + 3.4*y - 4 + np.random.randn(30)
fig, ax = plt.subplots()
scat = ax.scatter(x, y, c=z, s=200, marker='o')
fig.colorbar(scat)
plt.show()