I’m trying to plot some curves with matplotlib.
But, since these curve overlap with each other from viewport.
So only z-order can not help here.
I wonder if there is a function works like a depth buffer in matplotlib.
I’m plotting something like this.
And the red line should not always on top in 3D space.

I think it’s difficult to do such things in matplotlib, since it’s a 2D plot library with some 3D plot ability. I recommend some real 3D plot library, such as visvis, mayavi, vpython. For example, in visvis, you can create a 3D curve like:
mayavi: