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'))
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ali_d
  • 1,089
  • 9
  • 24

1 Answers1

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"))
GriefThief
  • 36
  • 1
  • 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. – Ali_d Jan 25 '23 at 10:04