I am trying to plot a surface image which intersects a point cloud. Here is what I am hoping to get as an output:
Here is what I am getting:
As you can see, the surface seems to overwrite the scatter plot. I have tried dividing the scatter plot in two around the plane, like so:
break_idx = np.searchsorted(ts, img_ts)
ax.scatter(xs[0:break_idx], ts[0:break_idx], ys[0:break_idx], zdir='z',
c=colors[0:break_idx], facecolors=colors[0:break_idx])
ax.plot_surface(y, img_ts, x, rstride=5, cstride=5, facecolors=img, alpha=1)
ax.scatter(xs[break_idx:-1], ts[break_idx:-1], ys[break_idx:-1], zdir='z',
c=colors[break_idx:-1], facecolors=colors[break_idx:-1])
However this has not worked for me. Any ideas what might be going on?
+++ EDIT +++
Thanks to @JohanC for his suggestions, unfortunately it resulted in the same issue, visualized here in GIF format:
Judging by my results and the comments, this is just a bug/limitation of matplotlibs 3D plotting abilities. Ohwell, time to learn to use mayavi
...
A working minimal example using mayavi
can be found here, although the reason for it being on stackoverflow is that I am encountering similar issues.