The problem here is that mplot3d does not have an OpenGL backend. Thus, the calculations for displaying data are based on 2d. I found the same problem here and workaround here . Although the workaround is not the best, in my opinion, because it depends on the resolution of your data.
In any case, I followed the second link . So what I'm doing now is copying the array and setting all the values above and below my desired scale in NaN. When building these lines, the lines will be cut off where the data will exceed the desired limit.
def SetAxis2(self): self.dummyx=CL.x*1 self.dummyy=CL.y*1 self.dummyz=CL.z*1
If now your scale is set in the range from 0 to 10, and you have six data points: [-1, 3 4 12 5 1] The line will go from 3 to 4 and from 5 to 1, because -1 and 12 will be set to NaN. Improving this problem would be good. Mayavi might be better, but I have not tried this since I wanted to stick with matplotlib.
lyvic source share