from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
import numpy as np
import csv
filename="D:/data/附件1.csv"
with open(filename) as f:
reader=csv.reader(f)
header_row=next(reader)
X,Y,Z=[ ],[ ],[ ]
for row in reader:
X=int(float(row[1]))
X.append(X)
Y = int(float(row[2]))
Y.append(Y)
Z= int(float(row[3]))
Z.append(Z)
ax=plt.subplot(1,2,2,projection='3d')
ax.plot_wireframe(X,Y,Z,c='red')
ax.set_title("基础面的三维图",fontsize=24)
ax.set_xlabel("x坐标",fontsize=16)
ax.set_ylabel("y坐标",fontsize=16)
ax.set_zlabel("z坐标",fontsize=16)
plt.savefig('figure2.png',dpi=500)
plt.show()
想画的三维图