user3670781 - 1 year ago 107

Python Question

Is it possible to disable the perspective when plotting in mplot3d, i.e. to use the orthogonal projection?

Answer Source

Sort of, you can run this snippet of code before you plot:

```
import numpy
from mpl_toolkits.mplot3d import proj3d
def orthogonal_proj(zfront, zback):
a = (zfront+zback)/(zfront-zback)
b = -2*(zfront*zback)/(zfront-zback)
return numpy.array([[1,0,0,0],
[0,1,0,0],
[0,0,a,b],
[0,0,0,zback]])
proj3d.persp_transformation = orthogonal_proj
```

It is currently an open issue found here.