如下代码:
import matplotlib as mpl
import numpy as np
import matplotlib.pyplot as plt
mpl.rcParams['legend.fontsize'] = 10
fig = plt.figure()
ax = fig.gca(projection='3d')
plt.xlabel('ai')
plt.ylabel('bi')
x = np.random.randint(0,10,20) # 生成20个随机整数
y = np.random.randint(0,10,20)
z = x/(x+y)
ax.plot(x, y, z, 'go-', label='Curve', )
ax.legend()
plt.show()