前言 假设有2个点[x1,y1,z1]和[b_x,b_y,b_z] 代码 fig = plt.figure() ax= fig.add_subplot(projection="3d") x,y,z = [x1,b_x],[y1,b_y],[z1,b_z] ax.scatter(x, y, z, c='red', s=100) ax.plot(x, y, z, color='black') plt.show()