Change clipping of objects in matplotlib 3D

88 Views Asked by At

I plot a 3D polygon and plot a scatterpoint on the face. However, the alpha of the scatterpoint changes so that it looks like it is under the polygon, rather than on the edge, depending on the orientation. How can I fix so it clips correctly?

collection = Poly3DCollection(verts, linewidths=1, edgecolors='black', alpha=0.5)
face_color = "salmon"
collection.set_facecolor(face_color)
ax.add_collection3d(collection)


ax.scatter(-.5,-.5,0,color='black',alpha=1,s=30)
ax.scatter(0,0,1,color='black',alpha=1)
ax.scatter(-1,0,0,color='black',alpha=1)

Scatterplot behind polygon:

scatterplot behind polygon

Scatterplot above polygon: scatterplot above polygon

I tried changing the order of plotting, and the alpha values for each plot point. However, it still always looks underneath completely from certain orientations.

0

There are 0 best solutions below