0

I want to fill between two curves in a 3D plot in matplotlib. I used this answer to do that. But I want to use a texture for filling rather than a single color. I very much appreciate any help. I used the following syntax but it did not work:

ax.add_collection3d(Poly3DCollection([verts],facecolor="none", hatch="x", edgecolor="orange")) 

In the original code is and has only color as an argument:

ax.add_collection3d(Poly3DCollection([verts],color='orange')) 

1 Answer 1

2

Setting the facecolor to none is returning an error there. It might be a bug but the workaround is to set facecolor=(0, 0, 0, 0):

ax.add_collection3d(Poly3DCollection([verts],facecolor=(0, 0, 0, 0), hatch="x", edgecolor="orange")) 
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks a alot for your help. I do appreciate it. Do you know any way if I can change the color of polygon with depth? Something like making a depth gradient from top to base of the polygon. Like a Red on top which change to red in the base.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.