I have referred to matplotlib.org and a lot of threads but I can't plot a 3d surface. I am able to plot a 3d scatter but as soon as I try to plot a 3d surface it breaks for a lot of different errors. I fix errors but I get new ones. After fighting with it for a 2 days I believe my understanding of matplotlib 3d surfaces is wrong.
I want to plot SA,FZ, FY
where SA is X, FZ is Y, FY is Z
while y<Last_Row:
if 100 < Temp_AVG_Dict[y] and Temp_AVG_Dict[y] < 140 and abs(Camber[y])<5 and 24.5<Speed[y] and Speed[y]<25.5:
y = y + 1
SA[SArow:]=[Run_50_sheet.cell_value( y , SA_Column)]
SArow = SArow + 1
FY[FYrow:] = [Run_50_sheet.cell_value( y , FY_Column)]
FYrow = FYrow + 1
FZ[FZrow:] = [Run_50_sheet.cell_value( y , FZ_Column)]
FZrow = FZrow + 1
Z.insert(SArow,[SA[SArow-1], FZ[FZrow-1], FY[FYrow-1]])
else:
y=y+1
Z= np.array(Z)
fig = plt.figure(1)
ax = fig.add_subplot(111, projection='3d')
This line below is where I believe I am going wrong. X,Y,Z need to all be 2d arrays but im unsure of the values that need to be input.
I tried making 2d arrays in the order of [SA,FZ], [FZ,FY], and [SA,FY] but that failed I also tried making SA and FY equal to 1..n but that didn't work either.
ax.plot_surface( SA, FY ,Z)
plt.show()
What values should the 2d arrays be made of? Any help is appreciated.