I am new to constructing 3D plots on Python. I am working on a code in which i am given the data of a ship, in terms of values of different sections. I have successfully been able to arrange the data in a form in which it gives a complete 3D plot of the ship. Here is the section of my code which gives the 3D plot.
fig = plt.figure()
ax = plt.axes(projection="3d")
X = np.array(new_list)
Y= np.array(YQ)
Z = np.array(ZQ)
ax.plot_surface(Y, Z, X, rstride=1, cstride=1,cmap='Purples', edgecolor='none')
ax.set_xlim(-80, 80)
ax.set_ylim(-80, 80)
ax.set_xlabel('Y')
ax.set_ylabel('Z')
ax.set_zlabel('X')
plt.show()
Please ignore me assigning different variables to the conventional ordering of axis. I understand it makes it a bit confusing, but the data was arranged in such a way and I had to work with it. Now I want to assign a different color to the part of the ship submerged in water. In my code, the variable Z represents the height of the ship, so basically I want to assign a different color to all the values less than Z = 0, as all values of Z less than 0 are submerged in water. What changes can I make in my code to do this task?