problem description
use matplotlib to draw 3D image curve, but do not know how to fill its closed space with color. Try the fill method in 2D, but it will prompt that it cannot be used in 3D module.
related codes
def draw3d(yy, zz, y_f, z_f, y_l, z_l):
figure = plt.figure()
ax_3d = figure.gca(projection="3d")
yy[-1].reverse()
zz[-1].reverse()
y_l.reverse()
z_l.reverse()
-sharpyzdraw_ydraw_z167float64
draw_y = y_f + yy[-1] + y_l + yy[0]
draw_z = z_f + zz[-1] + z_l + zz[0]
-sharpdraw_x = np.array([[500]*167]*167)
draw_z = np.array(draw_z)
draw_y = np.array(draw_y)
ax_3d.plot(draw_y, draw_z, zs=500, zdir="x") -sharp3
ax_3d.set(xlabel="x/mm", ylabel="y/mm", zlabel="z/mm")
plt.show()
figure.savefig("./x_500_3d.png")
what result do you expect? What is the error message actually seen?
as shown in the figure, I want the middle of the curve to be filled with color. Because yrecoery z is a collection of values, it is not a complete curve, but these points are connected by the plot method, so I do not know how to fill the space inside the blue edge.